For rendering a text (not html) message with ActionMailer in Rails 3, I see many threads instructing the programmer to make a .text.erb
file and run the following code:
mail do |format|
format.html
format.text
end
...but I wish to render a very short message, without using a mailer view at all. I have success doing this in html format but not in plain text.
I use the following code:
mail do |format|
format.html{ render( text: 'my text' ) }
format.text{ render( text: 'my text' ) }
end
...but it sends an html email every time. What can I do to send a plain-text email and specify its content without a mailer view file?