@@ 86-97 (lines=12) @@ | ||
83 | end |
|
84 | end |
|
85 | ||
86 | def send_user_approved_email(user) |
|
87 | begin |
|
88 | return unless Rails.configuration.enable_email_verification |
|
89 | ||
90 | UserMailer.approve_user(user, root_url, @settings).deliver_now |
|
91 | rescue => e |
|
92 | logger.error "Support: Error in email delivery: #{e}" |
|
93 | flash[:alert] = I18n.t(params[:message], default: I18n.t("delivery_error")) |
|
94 | else |
|
95 | flash[:success] = I18n.t("email_sent", email_type: t("verify.verification")) |
|
96 | end |
|
97 | end |
|
98 | ||
99 | def send_approval_user_signup_email(user) |
|
100 | begin |
|
@@ 37-48 (lines=12) @@ | ||
34 | end |
|
35 | ||
36 | # Sends password reset email. |
|
37 | def send_password_reset_email(user) |
|
38 | begin |
|
39 | return unless Rails.configuration.enable_email_verification |
|
40 | ||
41 | UserMailer.password_reset(user, reset_link(user), @settings).deliver_now |
|
42 | rescue => e |
|
43 | logger.error "Support: Error in email delivery: #{e}" |
|
44 | flash[:alert] = I18n.t(params[:message], default: I18n.t("delivery_error")) |
|
45 | else |
|
46 | flash[:success] = I18n.t("email_sent", email_type: t("reset_password.subtitle")) |
|
47 | end |
|
48 | end |
|
49 | ||
50 | def send_user_promoted_email(user, role) |
|
51 | begin |
|
@@ 23-34 (lines=12) @@ | ||
20 | extend ActiveSupport::Concern |
|
21 | ||
22 | # Sends account activation email. |
|
23 | def send_activation_email(user) |
|
24 | begin |
|
25 | return unless Rails.configuration.enable_email_verification |
|
26 | ||
27 | UserMailer.verify_email(user, user_verification_link(user), @settings).deliver |
|
28 | rescue => e |
|
29 | logger.error "Support: Error in email delivery: #{e}" |
|
30 | flash[:alert] = I18n.t(params[:message], default: I18n.t("delivery_error")) |
|
31 | else |
|
32 | flash[:success] = I18n.t("email_sent", email_type: t("verify.verification")) |
|
33 | end |
|
34 | end |
|
35 | ||
36 | # Sends password reset email. |
|
37 | def send_password_reset_email(user) |