Sha256: 5487e080f1eb7281865cbf966d9d03d74586a6b2869820e8f0222718759fc54c

Contents?: true

Size: 1.9 KB

Versions: 15

Compression:

Stored size: 1.9 KB

Contents

class MemberNotifier < ActionMailer::Base
  
  default :from => "#{Gluttonberg::Setting.get_setting("title")} <#{Gluttonberg::Setting.get_setting("from_email")}>"
  default_url_options[:host] = Rails.configuration.host_name 
  
  def password_reset_instructions(member_id ,  current_localization_slug = "")
    member = Gluttonberg::Member.find(member_id)
    setup_email
    @subject += "Password Reset Instructions"
    @recipients = member.email  
    @edit_password_reset_url = edit_member_password_reset_url( current_localization_slug,  member.perishable_token)
  end
  
  def confirmation_instructions(member_id ,  current_localization_slug = "")
    member = Gluttonberg::Member.find(member_id)
    setup_email
    @subject += "Confirmation Instructions"
    @recipients = member.email  
    @member_confirmation_url = member_confirmation_url(:locale => current_localization_slug , :key => member.confirmation_key)
  end
  
  # welcome email will be sent to member when admin user will create member. 
  # this member will be automatically verified 
  # purpose of this email is to provide login details to the member
  def welcome(member_id, current_localization_slug = "")
    @member = Gluttonberg::Member.find(member_id)
    setup_email
    @subject += "Confirmation Instructions"
    @recipients = @member.email  
    @password = Gluttonberg::Member.generateRandomString
    password_hash = {  
        :password => @password ,
        :password_confirmation => @password
    }
    @member.welcome_email_sent = true
    @member.assign_attributes(password_hash)
    @member.save
    @login_url = member_login_url
  end
  
  
  protected
  
    def setup_email
      @from        = "#{Gluttonberg::Setting.get_setting("title")} <#{Gluttonberg::Setting.get_setting("from_email")}>"
      @subject     = "[#{Gluttonberg::Setting.get_setting("title")}] "
      @sent_on     = Time.now
      @content_type = "text/html"
    end
    
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gluttonberg-core-2.6.4 app/mailer/member_notifier.rb
gluttonberg-core-2.6.3 app/mailer/member_notifier.rb
gluttonberg-core-2.6.2 app/mailer/member_notifier.rb
gluttonberg-core-2.6.1 app/mailer/member_notifier.rb
gluttonberg-core-2.6.0 app/mailer/member_notifier.rb
gluttonberg-core-2.5.9 app/mailer/member_notifier.rb
gluttonberg-core-2.5.8 app/mailer/member_notifier.rb
gluttonberg-core-2.5.7 app/mailer/member_notifier.rb
gluttonberg-core-2.5.6 app/mailer/member_notifier.rb
gluttonberg-core-2.5.5 app/mailer/member_notifier.rb
gluttonberg-core-2.5.4 app/mailer/member_notifier.rb
gluttonberg-core-2.5.3 app/mailer/member_notifier.rb
gluttonberg-core-2.5.2 app/mailer/member_notifier.rb
gluttonberg-core-2.5.1 app/mailer/member_notifier.rb
gluttonberg-core-2.5 app/mailer/member_notifier.rb