Skip to content

Commit fd984e8

Browse files
committed
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.).
1 parent df3c782 commit fd984e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

guides/source/action_mailer_basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ email address in the format `"Full Name <email>"`.
309309
```ruby
310310
def welcome_email(user)
311311
@user = user
312-
email_with_name = "#{@user.name} <#{@user.email}>"
312+
email_with_name = %("#{@user.name}" <#{@user.email}>)
313313
mail(to: email_with_name, subject: 'Welcome to My Awesome Site')
314314
end
315315
```

0 commit comments

Comments
 (0)