Class: AuthMailer

Inherits:
ApplicationMailer show all
Includes:
ActionView::Helpers::NumberHelper
Defined in:
app/mailers/auth_mailer.rb

Instance Method Summary collapse

Instance Method Details

#password_reset(user:, link:, app_mode:) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'app/mailers/auth_mailer.rb', line 25

def password_reset(user:, link:, app_mode:)
  I18n.locale = user.locale

  @user = user
  @link = link

  @software_name = app_mode.software_name
  @support_page = 'https://www.edi2xml.com/contact-edi2xml/'

  I18n.with_locale(user.locale) do
    mail(
      to: user.email,
      subject: "#{@software_name} | #{I18n.t('emails.password_reset.subject')}",
      from: Rails.application.config.from_email_address,
      template_name: "password_reset_#{I18n.locale}"
    )
  end
end

#verification(user:, link:, app_mode:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/mailers/auth_mailer.rb', line 6

def verification(user:, link:, app_mode:)
  I18n.locale = user.locale

  @user = user
  @link = link

  @software_name = app_mode.software_name
  @support_page = 'https://www.edi2xml.com/contact-edi2xml/'

  I18n.with_locale(user.locale) do
    mail(
      to: user.email,
      subject: "#{@software_name} | #{I18n.t('emails.verification.subject')}",
      from: Rails.application.config.from_email_address,
      template_name: "verification_#{I18n.locale}"
    )
  end
end