Sha256: d3044c8fbdeeb4eaa0eb385b8c585860222ae52384fbe681de115477d6d0b9e3

Contents?: true

Size: 648 Bytes

Versions: 10

Compression:

Stored size: 648 Bytes

Contents

module Rooler
  class DeliveryMailer < ActionMailer::Base
    helper ApplicationHelper
    include ApplicationHelper
    
    default :from => 'default@myapp.com'
        
    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

10 entries across 10 versions & 1 rubygems

Version Path
rooler-0.0.11 app/mailers/rooler/delivery_mailer.rb
rooler-0.0.10 app/mailers/rooler/delivery_mailer.rb
rooler-0.0.9 app/mailers/rooler/delivery_mailer.rb
rooler-0.0.8 app/mailers/rooler/delivery_mailer.rb
rooler-0.0.7 app/mailers/rooler/delivery_mailer.rb
rooler-0.0.6 app/mailers/rooler/delivery_mailer.rb
rooler-0.0.5 app/mailers/rooler/delivery_mailer.rb
rooler-0.0.4 app/mailers/rooler/delivery_mailer.rb
rooler-0.0.3 app/mailers/rooler/delivery_mailer.rb
rooler-0.0.2 app/mailers/rooler/delivery_mailer.rb