Sha256: efc760b913db4afeeab11abe22b0b611aca8d4d8352ff903d89644e67374d1ca

Contents?: true

Size: 1.04 KB

Versions: 11

Compression:

Stored size: 1.04 KB

Contents

class MuckCommerceMailer < ActionMailer::Base
  unloadable

  layout 'email_default'
  default_url_options[:host] = GlobalConfig.application_url

  def coupon_code(email, subject, message, coupon_code)
    setup_email(email)
    subject       subject
    body          :message => message, :coupon_code => coupon_code
  end

  def user_subscribe_notification(user, subscription)
    setup_email(user.email)
    subject       I18n.translate('muck.commerce.subscribe_notification_subject')
    body          :user => user, :trial_period => subscription.trial_period, :price => subscription.amount_price
  end

  protected
    def setup_email(email)
      recipients    email
      from          "#{GlobalConfig.from_email_name} <#{GlobalConfig.from_email}>"
      sent_on       Time.now
      content_type "text/html" # There is a bug in Rails that prevents multipart emails from working inside an engine.  See: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2263-rails-232-breaks-implicit-multipart-actionmailer-tests#ticket-2263-22
    end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
muck-commerce-0.2.8 app/models/muck_commerce_mailer.rb
muck-commerce-0.2.7 app/models/muck_commerce_mailer.rb
muck-commerce-0.2.6 app/models/muck_commerce_mailer.rb
muck-commerce-0.2.5 app/models/muck_commerce_mailer.rb
muck-commerce-0.2.4 app/models/muck_commerce_mailer.rb
muck-commerce-0.2.3 app/models/muck_commerce_mailer.rb
muck-commerce-0.2.2 app/models/muck_commerce_mailer.rb
muck-commerce-0.2.1 app/models/muck_commerce_mailer.rb
muck-commerce-0.2.0 app/models/muck_commerce_mailer.rb
muck-commerce-0.1.9 app/models/muck_commerce_mailer.rb
muck-commerce-0.1.8 app/models/muck_commerce_mailer.rb