Module: EffectivePostmarkHelper

Defined in:
app/helpers/effective_postmark_helper.rb

Instance Method Summary collapse

Instance Method Details

#effective_postmark_admin_alert(user, from: nil, html_class: 'alert alert-danger') ⇒ Object

For use on the admin/users#edit page



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

def effective_postmark_admin_alert(user, from: nil, html_class: 'alert alert-danger')
  raise('expected an effective_postmark_user') unless user.class.try(:effective_postmark_user?)
  return unless user.postmark_invalid?

  (:div, class: html_class) do
    [
      "This user has an inactive email address.",
      "They will not receive any emails",
      ("from #{from}" if from),
      "while inactive.",
      "Please update their email address, or" +
      link_to('reactivate their email', effective_postmark.postmark_reactivate_admin_postmark_path(user), 'data-method': :post),
      "and automatically attempt an email delivery."
    ].compact.join(' ').html_safe
  end
end

#effective_postmark_alert(user, from: nil, html_class: 'alert alert-danger') ⇒ Object

For use on the regular user alerts and forgot password pages



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/effective_postmark_helper.rb', line 4

def effective_postmark_alert(user, from: nil, html_class: 'alert alert-danger')
  raise('expected an effective_postmark_user') unless user.class.try(:effective_postmark_user?)
  return unless user.postmark_invalid?

  (:div, class: html_class) do
    [
      succeed(',') { "IMPORTANT: The email address you use to sign in#{" to #{from}" if from}" },
      succeed(',') { user.email },
      "has been marked as inactive.",
      "You will not receive any emails",
      ("from #{from}" if from),
      "while inactive.",
      "Please contact us to update your email address."
    ].compact.join(' ').html_safe
  end
end