-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AO3-5610 notify users when a bookmark or series they have created is hidden #4760
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -377,6 +377,18 @@ def admin_deleted_work_notification(user, work) | |||||||
end | ||||||||
end | ||||||||
|
||||||||
def admin_hidden_series_notification(creation_id, user_id) | ||||||||
@user = User.find_by(id: user_id) | ||||||||
@series = Series.find_by(id: creation_id) | ||||||||
|
||||||||
I18n.with_locale(@user.preference.locale.iso) do | ||||||||
mail( | ||||||||
to: @user.email, | ||||||||
subject: default_i18n_subject(app_name: ArchiveConfig.APP_SHORT_NAME) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs a comment to help out i18n-tasks:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update: The comment is no longer needed! Just merge the current master branch into this PR branch and i18n-tasks will recognize |
||||||||
) | ||||||||
end | ||||||||
end | ||||||||
|
||||||||
# Sends email to creators when a creation is hidden by an admin | ||||||||
def admin_hidden_work_notification(creation_id, user_id) | ||||||||
@user = User.find_by(id: user_id) | ||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,14 @@ | ||||||
<% content_for :message do %> | ||||||
<p><%= t("mailer.general.greeting.formal", name: style_bold(@user.login)).html_safe %></p> | ||||||
|
||||||
<p><%= t(".html.hidden", title: style_creation_link(@series.title, @series)).html_safe %></p> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
This applies to all keys you added in this file here, as well as the text version, where the key should be Furthermore, the variable name for links should end in
Suggested change
|
||||||
|
||||||
<p><%= t(".access") %></p> | ||||||
|
||||||
<p><%= t(".check_email") %></p> | ||||||
|
||||||
<p><%= t(".html.tos_violation", tos_link: tos_link(t ".tos")).html_safe %></p> | ||||||
Check failure on line 10 in app/views/user_mailer/admin_hidden_series_notification.html.erb GitHub Actions / ERB Lint runner
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The ideal configuration of parentheses would be this:
Suggested change
Similar for the abuse link below. |
||||||
|
||||||
<p><%= t(".html.help", contact_abuse_link: abuse_link(t ".contact_abuse")).html_safe %></p> | ||||||
Check failure on line 12 in app/views/user_mailer/admin_hidden_series_notification.html.erb GitHub Actions / ERB Lint runner
|
||||||
<% end %> | ||||||
|
||||||
Check failure on line 14 in app/views/user_mailer/admin_hidden_series_notification.html.erb GitHub Actions / ERB Lint runner
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<% content_for :message do %> | ||
<%= t("mailer.general.greeting.formal", name: @user.login) %> | ||
|
||
<%= t(".text.hidden", title: @series.title, series_url: series_url(@series)) %> | ||
|
||
<%= t(".access") %> | ||
|
||
<%= t(".check_email") %> | ||
|
||
<%= t(".text.tos_violation", tos_url: tos_url) %> | ||
|
||
<%= t(".text.help", contact_abuse_url: new_abuse_report_url) %> | ||
<% end %> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to reutilize the
admin_hidden_work_notification
action (maybe call itadmin_hidden_creation_notification
), and update the email contents by passing in parameters?or can we have separate mailer actions for when an admin hides works/series/bookmarks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I like separate actions for each. I think the contents of the emails could potentially have enough differences that it could get kind of messy trying to account for all of the variations.