diff options
author | Aditya Sanghi <asanghi@me.com> | 2010-09-25 14:49:28 +0530 |
---|---|---|
committer | Aditya Sanghi <asanghi@me.com> | 2010-09-25 14:49:28 +0530 |
commit | db8b3e71dc30e326a665f3b9d5c70473b8f08fa4 (patch) | |
tree | 4bf4dfd33612ddaa85c4766d6f7d0766558a6fe0 /railties/guides/source | |
parent | c94e92e2b080ef824bc63dae771173fd4f57e28e (diff) | |
download | rails-db8b3e71dc30e326a665f3b9d5c70473b8f08fa4.tar.gz rails-db8b3e71dc30e326a665f3b9d5c70473b8f08fa4.tar.bz2 rails-db8b3e71dc30e326a665f3b9d5c70473b8f08fa4.zip |
add section about email with name
Diffstat (limited to 'railties/guides/source')
-rw-r--r-- | railties/guides/source/action_mailer_basics.textile | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/railties/guides/source/action_mailer_basics.textile b/railties/guides/source/action_mailer_basics.textile index 16e611f285..35372d5429 100644 --- a/railties/guides/source/action_mailer_basics.textile +++ b/railties/guides/source/action_mailer_basics.textile @@ -258,6 +258,19 @@ It is possible to send email to one or more recipients in one email (for e.g. in end </ruby> +h5. Sending email with names + +Sometimes you wish to show the name of the person instead of just their email address when they receive the email. The trick to doing that is +to format the email address in the format <tt>"Name <email>"</tt>. + +<ruby> + def welcome_email(user) + @user = user + email_with_name = "#{@user.name} <#{@user.email}>" + mail(:to => email_with_name, + :subject => "Welcome to My Awesome Site") + end +</ruby> h4. Mailer Views |