Vitali Zakharoff
Vitali Zakharoff

Reputation: 353

How does Actionmailer work?

If I need send some letter to 2 people, how can I do this? I found docs in web, but I don't understand them, can you show me and explain me using simple language?

Upvotes: 1

Views: 719

Answers (2)

fl00r
fl00r

Reputation: 83680

Best you can find is Ryan's Railscast:

http://railscasts.com/episodes/206-action-mailer-in-rails-3

Also good guide is here:

http://guides.rubyonrails.org/action_mailer_basics.html

Actually you can read there not just about ActionMailer but about whole Rails kitchen.

Upvotes: 2

Bijendra
Bijendra

Reputation: 10025

def send_mail_persons(user)
  @user = user
  mail :to => @user.email, :subject => "Amusement.", :from => MAIL_ADDRESS
end

Here i have called the method send_mail_persons and passed the recipients info as a parameter.Also there is a simple way..

def send_mail_persons
  mail :to => MAILING_ADDRESS, :subject => "Amusement.", :from => MAIL_ADDRESS
end

and define both MAILING_ADDRESS and MAIL_ADDRESS in the constants.

Thanx

Upvotes: 5

Related Questions