Sha256: 253f0f7bad928d9dd813577dc7332ace1233f23c311c795150d0348c881fab2c

Contents?: true

Size: 1.61 KB

Versions: 8

Compression:

Stored size: 1.61 KB

Contents

class MuckUserMailer < ActionMailer::Base
  unloadable
  
  default_url_options[:host] = GlobalConfig.application_url
  
  def activation_confirmation(user)
    setup_email(user)
    subject   I18n.t('muck.users.activation_complete')
    body      :user => user
  end
  
  def activation_instructions(user)
    setup_email(user)
    subject   I18n.t('muck.users.activation_instructions')
    body      :user => user,
              :account_activation_url => activate_url(user.perishable_token)
  end

  def password_not_active_instructions(user)
    setup_email(user)
    subject   I18n.t('muck.users.account_not_activated', :application_name => GlobalConfig.application_name)
    body      :user => user
  end

  def password_reset_instructions(user)
    setup_email(user)
    subject   I18n.t('muck.users.password_reset_email_subject', :application_name => GlobalConfig.application_name)
    body      :user => user
  end

  def welcome_notification(user)
    setup_email(user)
    subject   I18n.t('muck.users.welcome_email_subject', :application_name => GlobalConfig.application_name)
    body      :login => user.login,
              :application_name => GlobalConfig.application_name
  end

  def username_request(user)
    setup_email(user)
    subject   I18n.t('muck.users.request_username_subject', :application_name => GlobalConfig.application_name)
    body      :login => user.login,
              :application_name => GlobalConfig.application_name
  end
  
  protected
  def setup_email(user)
    @recipients  = "#{user.email}"
    @from        = "#{GlobalConfig.from_email}"
    @sent_on     = Time.now
    @body[:user] = user
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
muck-users-0.1.4 app/models/muck_user_mailer.rb
muck-users-0.1.5 app/models/muck_user_mailer.rb
muck-users-0.1.6 app/models/muck_user_mailer.rb
muck-users-0.1.7 app/models/muck_user_mailer.rb
muck-users-0.1.3 app/models/muck_user_mailer.rb
muck-users-0.1.1 app/models/muck_user_mailer.rb
muck-users-0.1.2 app/models/muck_user_mailer.rb
muck-users-0.1.0 app/models/muck_user_mailer.rb