Forum: Ruby on Rails Using link_to and mail_to helpers with Activemailer

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
485071faf1681a4106e4a3420144269a?d=identicon&s=25 David Williams (dwilliams)
on 2007-02-06 15:04
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

In application_helper, I have two helpers that return the site URL in
different formats:

def site_url

def dotcom_name

I then use this in mail_footer:

<%= link_to "FAQ", "http://#{site_url}/main/faq" %>

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:

<%= mail_to("help@#{dotcom_name}" , "help@#{dotcom_name}" ,
   :subject => "Question from #{}" ,
   :encode => "javascript" ) %>

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,

This topic is locked and can not be replied to.