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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -