Friday, 15 August 2014

email - Rails mailer alternate from address -



email - Rails mailer alternate from address -

i can set default address in rails so;

class usermailer < actionmailer::base default :from => "\"company\" <company@example.com>" def custom_address(user) # want set address here mail(to: user.email, subject: 'custom address') end end

but how set custom address different method? can't see listed anywhere in docs

i may wrong, believe can override within mail service method.

class usermailer < actionmailer::base default :from => "\"company\" <company@example.com>" def custom_address(user) # want set address here mail(to: user.email, subject: 'custom address', from: 'asdf@other.com') end end

ruby-on-rails email ruby-on-rails-4 actionmailer

No comments:

Post a Comment