Sha256: b1402bab2922d543ac273014f1d298797e5ec0e60da0ba8119387977062e8350

Contents?: true

Size: 829 Bytes

Versions: 2

Compression:

Stored size: 829 Bytes

Contents

require 'mustache'

class ApplicationMailer < ActionMailer::Base

  layout 'mailer'

  def newsletter(campaign, subscriber)

    content_type  = "text/html"

    attrs = subscriber.attributes

    @campaign = campaign

    @subscriber = subscriber

    @body = campaign.compiled_template_for(subscriber).html_safe

    mail( from: "#{campaign.from_name}<#{campaign.from_email}>",
          to: subscriber.email,
          subject: campaign.subject,
          content_type: content_type,
          return_path: campaign.reply_email )
  end

  def test(campaign)

    content_type  = "text/html"

    mail( from: "#{campaign.from_name}<#{campaign.from_email}>",
          to: "miguelmichelson@gmail.com",
          subject: campaign.subject,
          body: campaign.html_content,
          content_type: content_type )
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chaskiq-0.0.3 app/mailers/application_mailer.rb
chaskiq-0.0.2 app/mailers/application_mailer.rb