-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send initial warning mail about deletion in 40 days
- Loading branch information
Showing
7 changed files
with
70 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class UserCleanerMailer < ApplicationMailer | ||
layout "warning_mail_layout" | ||
|
||
# Creates an email to inform a user that their account will be deleted. | ||
# | ||
# @param [Integer] num_days_until_deletion: | ||
# The number of days until the account will be deleted. | ||
def pending_deletion_email(num_days_until_deletion) | ||
user = params[:user] | ||
sender = "#{t("mailer.warning")} <#{DefaultSetting::PROJECT_EMAIL}>" | ||
I18n.locale = user.locale | ||
|
||
@num_days_until_deletion = num_days_until_deletion | ||
subject = t("mailer.pending_deletion_subject", | ||
num_days_until_deletion: @num_days_until_deletion) | ||
mail(from: sender, to: user.email, subject: subject, priority: "high") | ||
end | ||
end |
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,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<%= stylesheet_link_tag :email %> | ||
</head> | ||
|
||
<body> | ||
<div class="container text-center"> | ||
<%= email_image_tag('/MaMpf-Logo_96x96.png', class: 'img-fluid mb-2 pt-4 pb-3' ) %> | ||
<div class="jumbotron"> | ||
<%= yield %> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
12 changes: 12 additions & 0 deletions
12
app/views/user_cleaner_mailer/pending_deletion_email.html.erb
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 @@ | ||
<div class="container"> | ||
<div class="blockquote text-start"> | ||
<h3> | ||
<%= t('mailer.pending_deletion_subject', | ||
num_days_until_deletion: @num_days_until_deletion) %> | ||
</h3> | ||
<p> | ||
<%= t('mailer.pending_deletion_body_html', | ||
num_days_until_deletion: @num_days_until_deletion) %> | ||
</p> | ||
</div> | ||
</div> |
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
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