Michael
Michael

Reputation: 14218

How to set email message body in Rails

I'm using the code below in class UserMailer < ActionMailer::Base to send an email:

mail :to => "email@address", :subject => "Subject"

How do I add the message body?

Upvotes: 0

Views: 534

Answers (1)

Ganesh Kunwar
Ganesh Kunwar

Reputation: 2653

You must use the mailer view of same action for email body. If your mailer action is send_mail then your default mail body must be view/users/send_mail.html.erb For detail see the following link, http://guides.rubyonrails.org/action_mailer_basics.html#create-a-mailer-view

Upvotes: 2

Related Questions