ruby on rails - Mailer result as String? -
in our custom sales app our users able send emails based on text partials choose. need record sent mails in activity model. how mailer result string in order save it?
instead of calling deliver method send mail, can capture email message calling to_s. example, if have mailer:
class mymailer < actionmailer::base default :from => "sender@me.com" def my_email mail(:to => "destination@you.com", :subject => "mail subject") end end
you
mail_content = mymailer.my_email.to_s
Comments
Post a Comment