Fwd: Using url_for in ActionMailer templates

David Goodlad
2005-03-06T05:40:53Z

Oops, forgot to reply to the list!


---------- Forwarded message ----------
From: David Goodlad <dgoodlad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Sat, 5 Mar 2005 22:40:23 -0700
Subject: Re: [Rails] Using url_for in ActionMailer templates
To: Jeremy Kemper <jeremy-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org>


On Sat, 05 Mar 2005 19:49:25 -0800, Jeremy Kemper
<jeremy-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org>
wrote:
> Create the URL in your controller and pass it as a parameter to your
> mailer action.  Example AuthenticationController signup and confirm:
[snip]

This would work if I was doing hte mailing from my controller; instead
I am using an Observer object for my User class.  I watch for an
update on the user, and if they''re freshly confirmed, I send the
''welcome'' message.  If it''s a create, and
they''re not automatically
confirmed (like if I add directly from an admin interface), send the
''confirmation'' message.  I don''t think I have access
to the controller
there either.

Dave

--
Dave Goodlad
dgoodlad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org or
dave-eHfbeeWWzZOw5LPnMra/2Q@public.gmane.org