I have a script that is running as a runner script, its job is to find reports that have recently been published and send emails to the users notifying them of the reports. The reports are available online, but are also available via a generated PDF which the users can see by tacking on .pdf to the end of their URL. I want to attach the pdf to the email that the runner script sends out. The problem I''m facing is that the runner script cannot ''find'' the pdf and I dont know why - here are my guesses: 1. You have to authenticate to see the pdf reports (which is true, but im not sure if the action mailer needs to authenticate and cannot do that?) 2. I am only able to use the path of the pdf, not the full url. The pdf is available through a url obviously, but the url contains a subdomain - but because this is a runner script that runs behind the scenes, it has no context and therefor cannot determine the URL. I''m not sure which one is causing the failure, anyone have any ideas? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 31, 4:48 pm, Ryan Abbott <abbot...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a script that is running as a runner script, its job is to find > reports that have recently been published and send emails to the users > notifying them of the reports. The reports are available online, but > are also available via a generated PDF which the users can see by > tacking on .pdf to the end of their URL. > > I want to attach the pdf to the email that the runner script sends > out. The problem I''m facing is that the runner script cannot ''find'' > the pdf and I dont know why - here are my guesses: > > 1. You have to authenticate to see the pdf reports (which is true, but > im not sure if the action mailer needs to authenticate and cannot do > that?) > > 2. I am only able to use the path of the pdf, not the full url. The > pdf is available through a url obviously, but the url contains a > subdomain - but because this is a runner script that runs behind the > scenes, it has no context and therefor cannot determine the URL. >Are you trying to attach the pdf by giving actionmailer the path from the url that generates the pdf (ie /some_controller/some_id/ generate.pdf or similar) ? That sounds very roundabout, and just out of the box you need to give actionmailer a path to an actual file on disk. You''d be far better off invoking the actual pdf generation code from your script. Fred Fred> I''m not sure which one is causing the failure, anyone have any ideas?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Yes I am attempting to basically give it a URL, I''m not sure how else to do it.. On Feb 1, 3:27 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jan 31, 4:48 pm, Ryan Abbott <abbot...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > I have a script that is running as a runner script, its job is to find > > reports that have recently been published and send emails to the users > > notifying them of the reports. The reports are available online, but > > are also available via a generated PDF which the users can see by > > tacking on .pdf to the end of their URL. > > > I want to attach the pdf to the email that the runner script sends > > out. The problem I''m facing is that the runner script cannot ''find'' > > the pdf and I dont know why - here are my guesses: > > > 1. You have to authenticate to see the pdf reports (which is true, but > > im not sure if the action mailer needs to authenticate and cannot do > > that?) > > > 2. I am only able to use the path of the pdf, not the full url. The > > pdf is available through a url obviously, but the url contains a > > subdomain - but because this is a runner script that runs behind the > > scenes, it has no context and therefor cannot determine the URL. > > Are you trying to attach the pdf by giving actionmailer the path from > the url that generates the pdf (ie /some_controller/some_id/ > generate.pdf or similar) ? That sounds very roundabout, and just out > of the box you need to give actionmailer a path to an actual file on > disk. You''d be far better off invoking the actual pdf generation code > from your script. > > Fred > > Fred > > > > > I''m not sure which one is causing the failure, anyone have any ideas?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ryan Abbott wrote:> Yes I am attempting to basically give it a URL, I''m not sure how else > to do it.. > > On Feb 1, 3:27�am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>Why are you mailing the PDF files anyway? The URL should be sufficient. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 10, 5:30 am, Ryan Abbott <abbot...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Yes I am attempting to basically give it a URL, I''m not sure how else > to do it..Well you''ve got code to generate a pdf document, use that to save it as a temporary file and attach that temporary file to the email. Fred> > On Feb 1, 3:27 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > On Jan 31, 4:48 pm, Ryan Abbott <abbot...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I have a script that is running as a runner script, its job is to find > > > reports that have recently been published and send emails to the users > > > notifying them of the reports. The reports are available online, but > > > are also available via a generated PDF which the users can see by > > > tacking on .pdf to the end of their URL. > > > > I want to attach the pdf to the email that the runner script sends > > > out. The problem I''m facing is that the runner script cannot ''find'' > > > the pdf and I dont know why - here are my guesses: > > > > 1. You have to authenticate to see the pdf reports (which is true, but > > > im not sure if the action mailer needs to authenticate and cannot do > > > that?) > > > > 2. I am only able to use the path of the pdf, not the full url. The > > > pdf is available through a url obviously, but the url contains a > > > subdomain - but because this is a runner script that runs behind the > > > scenes, it has no context and therefor cannot determine the URL. > > > Are you trying to attach the pdf by giving actionmailer the path from > > the url that generates the pdf (ie /some_controller/some_id/ > > generate.pdf or similar) ? That sounds very roundabout, and just out > > of the box you need to give actionmailer a path to an actual file on > > disk. You''d be far better off invoking the actual pdf generation code > > from your script. > > > Fred > > > Fred > > > > I''m not sure which one is causing the failure, anyone have any ideas?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.