Hi, everyone.
I''ve been looking at sending out emails recently from my app and seem
to
be getting some frustrating behaviour from a partial that I use to
construct the email views. Using HTML emails rather than plaintext.
The email view renders a standard _mail_footer.rhtml partial that I''ve
created.
In application_helper, I have two helpers that return the site URL in
different formats:
[CODE]
def site_url
"www.example.com"
end
def dotcom_name
"example.com"
end
[/CODE]
I then use this in mail_footer:
[CODE]
<%= link_to "FAQ", "http://#{site_url}/main/faq" %>
[/CODE]
At this point, the site_url helper works without a problem. The link is
correctly created in the emails that arrive.
But I then try using the mail_to helper to construct a mailto link in
the email, this time using dotcom_name:
[CODE]
<%= mail_to("help@#{dotcom_name}" , "help@#{dotcom_name}"
,
:subject => "Question from #{@user.name}" ,
:encode => "javascript" ) %>
[/CODE]
In the emails that arrive, the mailto seems to be missing completely.
Could someone please point out to me what incredibly obvious thing I''m
doing wrong? I''ve had a search through the posts here, but
can''t yet
find the solution.
Thank you for your time,
Dave
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---