Sha256: 92c9bd39cd39f0c210ec6da1da5240fa1dfa7a1057d5acf95c7236819ccb440f

Contents?: true

Size: 875 Bytes

Versions: 20

Compression:

Stored size: 875 Bytes

Contents

class UserMailer < ActionMailer::Base
  default :from => ErpTechSvcs::Config.email_notifications_from

  def activation_needed_email(user)
    @user = user
    @url  = "#{get_domain(user.instance_attributes[:domain])}/users/activate/#{user.activation_token}"
    @url << "?login_url=#{@user.instance_attributes[:login_url]}" unless @user.instance_attributes[:login_url].nil?
    mail(:to => user.email, :subject => "An account has been created and needs activation")
  end

  def reset_password_email(user)
    @user = user
    @url  = "#{get_domain(user.instance_attributes[:domain])}#{@user.instance_attributes[:login_url]}"
    mail(:to => user.email, :subject => "Your password has been reset")
  end

  def get_domain(domain)
    domain = domain || ErpTechSvcs::Config.installation_domain
    domain = "http://#{domain}" if domain.index('http').nil?
    domain
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
erp_tech_svcs-3.1.8 app/mailers/user_mailer.rb
erp_tech_svcs-3.1.7 app/mailers/user_mailer.rb
erp_tech_svcs-3.1.5 app/mailers/user_mailer.rb
erp_tech_svcs-3.1.4 app/mailers/user_mailer.rb
erp_tech_svcs-3.1.3 app/mailers/user_mailer.rb
erp_tech_svcs-3.1.2 app/mailers/user_mailer.rb
erp_tech_svcs-3.1.1 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.12 app/mailers/user_mailer.rb
erp_tech_svcs-3.1.0 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.11 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.10 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.9 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.8 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.7 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.6 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.5 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.4 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.3 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.2 app/mailers/user_mailer.rb
erp_tech_svcs-3.0.1 app/mailers/user_mailer.rb