Send email to activate user account after signup.
# File app/mailers/user_mailer.rb, line 13 def activation_needed_email(user, should_send = false) #mail will be sent only if should_sent id true # return unless should_sent @user = user @url = activate_user_url(user.activation_token) mail(to: user.email, bcc: Configurations::General.bcc_list, subject: "Welcome to #{Configurations::General.application_name}, activation required") do |format| format.html { render :layout => 'mailer' } end end
Send email when user account get activated successfully.
# File app/mailers/user_mailer.rb, line 23 def activation_success_email(user, should_send = false) @user = user @url = root_url mail(to: user.email, bcc: Configurations::General.bcc_list, subject: "Your account is now activated") do |format| format.html { render :layout => template_signup(user) } end end
Send email to intimate user to complete his profile.
# File app/mailers/user_mailer.rb, line 4 def intimation_profile_completion_email(user, resource, should_send = false) @user = user @url = root_url mail(to: user.email, bcc: Configurations::General.bcc_list, subject: "You have received the mail for completion of profile on #{Configurations::General.application_name}.") do |format| format.html { render :layout => 'mailer' } end end
Invite email to user friend to join this community.
# File app/mailers/user_mailer.rb, line 50 def invitation_email(invite, inviter, message) @invite = invite @message = message @sender_name = inviter.name mail(to: invite.invitee_email, bcc: Configurations::General.bcc_list, subject: "#{inviter.full_name} invited you to join #{Configurations::General.application_name}.") do |format| format.html { render :layout => 'mailer' } end end
Send the invite email for event's members
# File app/mailers/user_mailer.rb, line 60 def invitation_email_schedule(invite, inviter, message, invite_resource) @invite = invite @message = message @sender = inviter @schedule = Schedule.find(invite_resource.resource_id) if @schedule.grouped? @group = @schedule.shares.last.shared_to else @group = @schedule end mail(to: invite.invitee_email, bcc: Configurations::General.bcc_list, subject: "#{inviter.full_name} invited you to join #{Configurations::General.application_name}.") do |format| format.html { render :layout => 'mailer' } end end
Email for password update request.
# File app/mailers/user_mailer.rb, line 41 def password_update_email(user) @user = user @url = root_url mail(to: user.email, bcc: Configurations::General.bcc_list, subject: "Password reset") do |format| format.html { render :layout => 'mailer' } end end
Profile completion email.
# File app/mailers/user_mailer.rb, line 76 def profile_completion(user) @user = user unless user.admin? mail(to: User.admin.pluck(:email) | Admin.pluck(:email), subject: "The new user has completed his profile.") do |format| format.html { render :layout => 'mailer' } end end end
email for password reset request.
# File app/mailers/user_mailer.rb, line 32 def reset_password_email(user) @user = user @url = edit_password_url(user.reset_password_token) mail(to: user.email, bcc: Configurations::General.bcc_list, subject: "Your password reset request") do |format| format.html { render :layout => 'mailer' } end end
Email on Level updation.
# File app/mailers/user_mailer.rb, line 86 def user_level_updated_email(user,user_level,rate) @user = user @user_level = user_level @rate = ((rate/100).to_f).round(2) mail(to: user.email, subject: "Your user level changed.") do |format| format.html {render :layout => 'mailer'} end end