You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
687 B
27 lines
687 B
2 years ago
|
class LocationOrSchemeDeactivationMailer < NotifyMailer
|
||
|
DEACTIVATION_TEMPLATE_ID = "8d07a8c3-a4e3-4102-8be7-4ee79e4183fd".freeze
|
||
|
|
||
|
def send_deactivation_mail(user, log_count, update_logs_url, scheme_name, postcode = nil)
|
||
|
send_email(
|
||
|
user.email,
|
||
|
DEACTIVATION_TEMPLATE_ID,
|
||
|
{
|
||
|
log_count:,
|
||
|
log_or_logs: log_count == 1 ? "log" : "logs",
|
||
|
update_logs_url:,
|
||
|
location_or_scheme_description: description(scheme_name, postcode),
|
||
|
},
|
||
|
)
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def description(scheme_name, postcode)
|
||
|
if postcode
|
||
|
"the #{postcode} location from the #{scheme_name} scheme"
|
||
|
else
|
||
|
"the #{scheme_name} scheme"
|
||
|
end
|
||
|
end
|
||
|
end
|