Permalink
Browse files

fix bug in email with name example code

The display name in the email "to" field needs to be quoted otherwise
your email-sending service will fail when trying to deliver mail to
user's with commas in their name (i.e. John Smith, M.D.).
  • Loading branch information...
1 parent df3c782 commit fd984e850050710bfcba45c641757bce24072e12 @samdec samdec committed Jun 12, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 guides/source/action_mailer_basics.md
@@ -309,7 +309,7 @@ email address in the format `"Full Name <email>"`.
```ruby
def welcome_email(user)
@user = user
- email_with_name = "#{@user.name} <#{@user.email}>"
+ email_with_name = %("#{@user.name}" <#{@user.email}>)
mail(to: email_with_name, subject: 'Welcome to My Awesome Site')
end
```

0 comments on commit fd984e8

Please sign in to comment.