Class: MemberNotifier

Inherits:
Gluttonberg::BaseNotifier show all
Defined in:
app/mailer/member_notifier.rb

Instance Method Summary collapse

Instance Method Details

#confirmation_instructions(member_id, current_localization_slug = "") ⇒ Object



12
13
14
15
16
17
18
# File 'app/mailer/member_notifier.rb', line 12

def confirmation_instructions(member_id ,  current_localization_slug = "")
  member = Gluttonberg::Member.find(member_id)
  setup_email
  @subject += "Confirmation Instructions"
  @member_confirmation_url = member_confirmation_url(:locale => current_localization_slug , :key => member.confirmation_key)
  mail(:to => member.email, :subject => @subject)
end

#password_reset_instructions(member_id, current_localization_slug = "") ⇒ Object



3
4
5
6
7
8
9
10
# File 'app/mailer/member_notifier.rb', line 3

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)
  mail(:to => member.email, :subject => @subject)
end

#welcome(member_id, current_localization_slug = "") ⇒ Object

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



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/mailer/member_notifier.rb', line 23

def welcome(member_id, current_localization_slug = "")
  @member = Gluttonberg::Member.find(member_id)
  setup_email
  @subject += "Your account is registered"
  @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 = 
  mail(:to => @member.email, :subject => @subject)
end