-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-6828 Email users about TOS update and Underage warning rename (#4952
- Loading branch information
Showing
9 changed files
with
160 additions
and
26 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
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,11 @@ | ||
class TosUpdateMailer < ApplicationMailer | ||
# Sent by notifications:send_tos_update | ||
def tos_update_notification(user, admin_post_id) | ||
@username = user.login | ||
@admin_post = admin_post_id | ||
mail( | ||
to: user.email, | ||
subject: "[#{ArchiveConfig.APP_SHORT_NAME}] Updates to #{ArchiveConfig.APP_SHORT_NAME}'s Terms of Service" | ||
) | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
app/views/tos_update_mailer/tos_update_notification.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,16 @@ | ||
<% content_for :message do %> | ||
<p><%= t("mailer.general.greeting.formal_html", name: style_bold(@username)) %></p> | ||
|
||
<p>In order to make AO3's rules clearer to our users, we intend to update the AO3 Terms of Service (TOS) later this year. Once this occurs, you will need to agree to the updated TOS in order to continue using AO3.</p> | ||
|
||
<p>Here are the highlights of the changes in the 2024 version of the TOS:</p> | ||
|
||
<ul><li>We've clarified the Content Policy, but we haven't changed what works are or are not allowed. <%= style_bold("If your fanwork was allowed on AO3 before, then it is still allowed.") %></li> | ||
<li>The TOS has been split into three pages (General Principles, Content Policy, and Privacy Policy). This should make it easier to find what you're looking for when you want to know about a specific part of the TOS.</li> | ||
<li>We've simplified the language throughout the TOS and removed redundant or overly specific phrases and passages. When longer explanations would help to provide clarity, we've added new questions to the TOS FAQ instead.</li> | ||
<li>We've updated the descriptions of how we and our subprocessors collect and process user information (including personal information) in the Privacy Policy.</li> | ||
<li>The Abuse Policy has been generalized to provide the AO3 Policy & Abuse committee with greater flexibility to determine how to address TOS violations, while still providing protections for fanworks in accordance with AO3's mission.</li> | ||
<li>The "Underage" Archive Warning, which is used for works that depict or describe underage sex, will be renamed to "Underage Sex". This does not change the meaning of this warning or how it is enforced. When the TOS update occurs, <%= style_bold('all works with the "Underage" Archive Warning will be recategorized automatically to display the new "Underage Sex" Archive Warning label instead.') %> If you have a work that carries the "Underage" warning and you don't want it to display the "Underage Sex" label, you can replace it with the "Creator Chose Not to Use Archive Warnings" label at any time.</li></ul> | ||
|
||
<p>You can learn more about the intended changes, access the full draft text, ask questions, and provide public feedback by visiting our <%= style_link(style_bold("news post about the 2024 Terms of Service updates"), admin_post_url(@admin_post)) %>.</p> | ||
<% end %> |
16 changes: 16 additions & 0 deletions
16
app/views/tos_update_mailer/tos_update_notification.text.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,16 @@ | ||
<% content_for :message do %> | ||
<%= t("mailer.general.greeting.formal_html", name: @username) %> | ||
|
||
In order to make AO3's rules clearer to our users, we intend to update the AO3 Terms of Service (TOS) later this year. Once this occurs, you will need to agree to the updated TOS in order to continue using AO3. | ||
|
||
Here are the highlights of the changes in the 2024 version of the TOS: | ||
|
||
- We've clarified the Content Policy, but we haven't changed what works are or are not allowed. If your fanwork was allowed on AO3 before, then it is still allowed. | ||
- The TOS has been split into three pages (General Principles, Content Policy, and Privacy Policy). This should make it easier to find what you're looking for when you want to know about a specific part of the TOS. | ||
- We've simplified the language throughout the TOS and removed redundant or overly specific phrases and passages. When longer explanations would help to provide clarity, we've added new questions to the TOS FAQ instead. | ||
- We've updated the descriptions of how we and our subprocessors collect and process user information (including personal information) in the Privacy Policy. | ||
- The Abuse Policy has been generalized to provide the AO3 Policy & Abuse committee with greater flexibility to determine how to address TOS violations, while still providing protections for fanworks in accordance with AO3's mission. | ||
- The "Underage" Archive Warning, which is used for works that depict or describe underage sex, will be renamed to "Underage Sex". This does not change the meaning of this warning or how it is enforced. When the TOS update occurs, all works with the "Underage" Archive Warning will be recategorized automatically to display the new "Underage Sex" Archive Warning label instead. If you have a work that carries the "Underage" warning and you don't want it to display the "Underage Sex" label, you can replace it with the "Creator Chose Not to Use Archive Warnings" label at any time. | ||
|
||
You can learn more about the intended changes, access the full draft text, ask questions, and provide public feedback by visiting our news post about the 2024 Terms of Service updates: <%= admin_post_url(@admin_post) %>. | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
namespace :notifications do | ||
|
||
desc "Send next set of kudos notifications" | ||
task(:deliver_kudos => :environment) do | ||
task(deliver_kudos: :environment) do | ||
RedisMailQueue.deliver_kudos | ||
end | ||
|
||
desc "Send next set of subscription notifications" | ||
task(:deliver_subscriptions => :environment) do | ||
task(deliver_subscriptions: :environment) do | ||
RedisMailQueue.deliver_subscriptions | ||
end | ||
|
||
end | ||
|
||
# Usage with 10473 as admin post id: rails notifications:send_tos_update[10473] | ||
desc "Send TOS Update notification to all users" | ||
task(:send_tos_update, [:admin_post_id] => [:environment]) do |_t, args| | ||
total_users = User.all.size | ||
total_batches = (total_users + 999) / 1000 | ||
puts "Notifying #{total_users} users in #{total_batches} batches" | ||
|
||
User.find_in_batches.with_index do |batch, index| | ||
batch.each do |user| | ||
TosUpdateMailer.tos_update_notification(user, args.admin_post_id).deliver_later(queue: :tos_update) | ||
end | ||
|
||
batch_number = index + 1 | ||
progress_msg = "Batch #{batch_number} of #{total_batches} complete" | ||
puts(progress_msg) && $stdout.flush | ||
end | ||
puts && $stdout.flush | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require "spec_helper" | ||
|
||
describe "rake notifications:send_tos_update" do | ||
let(:admin_post) { create(:admin_post) } | ||
|
||
context "with one user" do | ||
let!(:user) { create(:user) } | ||
|
||
it "enqueues one tos update notifications" do | ||
ActiveJob::Base.queue_adapter = :test | ||
expect(User.all.size).to eq(1) | ||
expect { subject.invoke(admin_post.id) } | ||
.to have_enqueued_mail(TosUpdateMailer, :tos_update_notification).on_queue(:tos_update).with(user, admin_post.id) | ||
end | ||
end | ||
|
||
context "with multiple users" do | ||
before { create_list(:user, 10) } | ||
|
||
it "enqueues multiple tos update notifications" do | ||
ActiveJob::Base.queue_adapter = :test | ||
expect(User.all.size).to eq(10) | ||
expect { subject.invoke(admin_post.id) } | ||
.to have_enqueued_mail(TosUpdateMailer, :tos_update_notification).on_queue(:tos_update).with(instance_of(User), admin_post.id).exactly(10) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require "spec_helper" | ||
|
||
describe TosUpdateMailer do | ||
describe "#tos_update_notification" do | ||
let(:user) { create(:user) } | ||
let(:admin_post) { create(:admin_post) } | ||
let(:email) { TosUpdateMailer.tos_update_notification(user, admin_post.id) } | ||
|
||
it_behaves_like "an email with a valid sender" | ||
it_behaves_like "a multipart email" | ||
it_behaves_like "a translated email" | ||
|
||
it "has the correct subject line" do | ||
subject = "[#{ArchiveConfig.APP_SHORT_NAME}] Updates to #{ArchiveConfig.APP_SHORT_NAME}'s Terms of Service" | ||
expect(email).to have_subject(subject) | ||
end | ||
|
||
it "delivers to the correct address" do | ||
expect(email).to deliver_to(user.email) | ||
end | ||
|
||
describe "HTML version" do | ||
it "has the correct content" do | ||
expect(email).to have_html_part_content("are or are not allowed. <b") | ||
expect(email).to have_html_part_content(">If your fanwork was allowed on AO3 before, then it is still allowed.</b>") | ||
expect(email).to have_html_part_content("href=\"#{admin_post_url(admin_post)}\"><b") | ||
expect(email).to have_html_part_content(">news post about the 2024 Terms of Service updates</b></a>") | ||
end | ||
end | ||
|
||
describe "text version" do | ||
it "has the correct content" do | ||
expect(email).to have_text_part_content("are or are not allowed. If your fanwork was allowed on AO3 before, then it is still allowed.") | ||
expect(email).to have_text_part_content("news post about the 2024 Terms of Service updates: #{admin_post_url(admin_post)}") | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class TosUpdateMailerPreview < ApplicationMailerPreview | ||
# Sent by notifications:send_tos_update | ||
def tos_update_notification | ||
user = create(:user, :for_mailer_preview) | ||
admin_post = create(:admin_post) | ||
TosUpdateMailer.tos_update_notification(user, admin_post.id) | ||
end | ||
end |