diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-09-09 17:25:09 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-09-09 17:25:44 +0530 |
commit | 2db79dc9ea0b623c6d76b72e85f58efd63b50e08 (patch) | |
tree | 2db0a614b9f03c7c95ec0495f20ac0e5e506d981 /guides/source/action_mailer_basics.textile | |
parent | decf4a164d2b00f0be3fc8331df0f0cbe16e7e94 (diff) | |
download | rails-2db79dc9ea0b623c6d76b72e85f58efd63b50e08.tar.gz rails-2db79dc9ea0b623c6d76b72e85f58efd63b50e08.tar.bz2 rails-2db79dc9ea0b623c6d76b72e85f58efd63b50e08.zip |
minor fixes and edits [ci skip]
Diffstat (limited to 'guides/source/action_mailer_basics.textile')
-rw-r--r-- | guides/source/action_mailer_basics.textile | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/guides/source/action_mailer_basics.textile b/guides/source/action_mailer_basics.textile index 9c4ce47945..5f09b8e410 100644 --- a/guides/source/action_mailer_basics.textile +++ b/guides/source/action_mailer_basics.textile @@ -412,18 +412,15 @@ The above will send a multipart email with an attachment, properly nested with t h5. Sending Emails with Dynamic Delivery Options -At times you may wish to override the default delivery options (e.g. smtp credentials) while delivering emails. This can be achieved using +delivey_method_options+ in the mailer action. +If you wish to override the default delivery options (e.g. SMTP credentials) while delivering emails, you can do this using +delivery_method_options+ in the mailer action. <ruby> class UserMailer < ActionMailer::Base def welcome_email(user,company) @user = user @url = user_url(@user) - mail(:to => user.email, - :subject => "Please see the Terms and Conditions attached", - :delivery_method_options => {:user_name => company.smtp_user, - :password => company.smtp_password, - :address => company.smtp_host}) + delivery_options = { user_name: company.smtp_user, password: company.smtp_password, address: company.smtp_host } + mail(to: user.email, subject: "Please see the Terms and Conditions attached", delivery_method_options: delivery_options) end end </ruby> |