Sha256: a70910cbdbab8d8cb4d02ea4904bd391a5b713bf89523256fb85c8ec64c556fb

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

module Rooler
  class DeliveryMailer < ActionMailer::Base
    helper ApplicationHelper
    include ApplicationHelper
        
    def send_mail(delivery, to_email = nil)
       template = delivery.template
       deliverable = delivery.deliverable
       
       @liquid_variables = {deliverable.class.name.demodulize.downcase.to_s => deliverable}
       @body = template.body
       
       mail to: to_email || liquidize(template.to, @liquid_variables),
            cc: liquidize(template.cc, @liquid_variables), 
            subject: liquidize(template.subject, @liquid_variables)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rooler-0.0.1 app/mailers/rooler/delivery_mailer.rb