Class: ActsAsNewsletter::Mailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/acts_as_newsletter/mailer.rb

Instance Method Summary collapse

Instance Method Details

#newsletter(newsletter, email, mail_config) ⇒ Object

Sends the actual newsletter to the specified email



10
11
12
13
14
15
16
17
18
# File 'lib/acts_as_newsletter/mailer.rb', line 10

def newsletter newsletter, email, mail_config
  @newsletter = newsletter
  @email = email
  mail mail_config.merge(
    to: email,
    subject: newsletter.subject,
    from: (mail_config[:from] or from)
  )
end