-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mailer to send requested CSV file
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class Admin::Statistics::NominationMailer < ApplicationMailer | ||
layout "mailer" | ||
|
||
def notify(identifier, file_identifier) | ||
@admin = Admin.find(identifier) | ||
@file = @admin.protected_files.find(file_identifier) | ||
|
||
subject = "Nomination statistics export - King's Award for Voluntary Service" | ||
|
||
view_mail ENV["GOV_UK_NOTIFY_API_TEMPLATE_ID"], to: @admin.email, subject: subject_with_env_prefix(subject) | ||
end | ||
end |
18 changes: 18 additions & 0 deletions
18
app/views/admin/statistics/nomination_mailer/notify.html.slim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
p.govuk-body | ||
= "Dear #{@admin.first_name}," | ||
|
||
p.govuk-body | ||
' You requested an export of nomination statistics. | ||
|
||
p.govuk-body | ||
' Please find this report on the link below: | ||
|
||
p.govuk-body | ||
= link_to admin_protected_file_url(@file), admin_protected_file_url(@file) | ||
|
||
p.govuk-body | ||
' Kind Regards, | ||
|
||
br | ||
|
||
' The King's Awards Office |