Class: PolicyManager::PortabilityMailer

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/policy_manager/portability_mailer.rb

Instance Method Summary collapse

Instance Method Details

#admin_notification(user_id) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'app/mailers/policy_manager/portability_mailer.rb', line 35

def admin_notification(user_id)
  @user = find_user_resource(user_id)

  opts = { from: Config.from_email, to: Config.admin_email(@user), subject: I18n.t("terms_app.mails.admin.subject", email: @user.email) }
  opts.merge!({
    template_path: PolicyManager::Config.exporter.mailer_templates[:path].to_s,
    template_name: PolicyManager::Config.exporter.mailer_templates[:admin]
  }) if has_custom_template?(:admin)

  set_mail_lang

  mail(opts)
end

#completed_notification(portability_request_id) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/mailers/policy_manager/portability_mailer.rb', line 19

def completed_notification(portability_request_id)
  @portability_request = PortabilityRequest.find(portability_request_id)
  @user = find_user_resource(@portability_request.user_id)
  @link = @portability_request.download_link

  opts = { from: Config.from_email, to: @user.email, subject: I18n.t("terms_app.mails.completed.subject") }
  opts.merge!({
    template_path: PolicyManager::Config.exporter.mailer_templates[:path].to_s,
    template_name: PolicyManager::Config.exporter.mailer_templates[:complete]
  }) if has_custom_template?(:complete)

  set_mail_lang

  mail(opts)
end

#progress_notification(portability_request_id) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/mailers/policy_manager/portability_mailer.rb', line 4

def progress_notification(portability_request_id)
  @portability_request = PortabilityRequest.find(portability_request_id)
  @user = find_user_resource(@portability_request.user_id)

  opts = { from: Config.from_email, to: @user.email, subject: I18n.t("terms_app.mails.progress.subject") }
  opts.merge!({
    template_path: PolicyManager::Config.exporter.mailer_templates[:path].to_s,
    template_name: PolicyManager::Config.exporter.mailer_templates[:progress]
  }) if has_custom_template?(:progress)

  set_mail_lang

  mail(opts)
end