diff --git a/.travis.yml b/.travis.yml index a1b05c9242..5f6bcdf1fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ script: - yarn install - yarn audit - yarn lint - - bin/rails test + - bundle exec rails test - yarn test - bundle exec brakeman - bundle exec rubocop diff --git a/app/mailers/publisher_mailer.rb b/app/mailers/publisher_mailer.rb index df853967ac..8b7027dbf8 100644 --- a/app/mailers/publisher_mailer.rb +++ b/app/mailers/publisher_mailer.rb @@ -341,6 +341,13 @@ def email_user_on_hold(publisher) ) end + def update_to_tos(publisher) + @publisher = publisher + mail( + to: @publisher.email || @publisher.pending_email, + subject: default_i18n_subject + ) + end private diff --git a/app/views/publisher_mailer/update_to_tos.html.slim b/app/views/publisher_mailer/update_to_tos.html.slim new file mode 100644 index 0000000000..110b79fcc6 --- /dev/null +++ b/app/views/publisher_mailer/update_to_tos.html.slim @@ -0,0 +1,3 @@ +p.salutation= t "publisher_mailer.shared.salutation", name: @publisher.name + +p== t(".body", link: ENV["CALENDLY_LINK"], month: Date.today.strftime("%B")) diff --git a/config/locales/en.yml b/config/locales/en.yml index 0132b6e212..e553911486 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -274,6 +274,73 @@ en: Thank you.

The Brave Rewards | Creator team + update_to_tos: + subject: Updates to the Brave Rewards Terms of Service for Creators + body: > +

+ We know it’s not glamorous or exciting, but we’ve made some changes to the Brave Rewards Terms of Service. We'd love for you to take a look so that you can see the whole updated document. But just to make things a little easier, here’s a quick summary of all the recent changes. +

+ In June: + + + + + + + + + + + + + +
+ We made it clear we would not send BAT belonging to Brave (including UGP grants and referral payments) to anyone who encourages or engages in violence. +
+ We explained how UGP grants work in the terms for publishers, where it was previously only in the user terms. +
+ We noted that we are the judge of what is and isn’t the prohibited conduct described in §8. +
+
+ In April: + + + + + +
+ We launched Brave Ads! Now there are terms for advertisers, and the terms for publishers reflects that. +
+
+ In March: + + + + + + + + + + + + + +
+ We made it possible for people aged 16 and up to use Brave Rewards with a parent’s permission. +
+ We rewrote §4, which explains how contributions work. Contributions essentially didn’t change, we just described them better. +
+ We also made some formatting changes which you might not notice, but we think makes the whole thing easier to read. +
+ +

This is only a summary. It doesn’t describe everything that changed. You should read the actual real policy.

+ +

+ Thanks for being a Brave Rewards Creator, +
+ The Brave Rewards Team +

login_email: subject: Log in to Brave Rewards body_html: | diff --git a/lib/tasks/email_tos_update.rake b/lib/tasks/email_tos_update.rake new file mode 100644 index 0000000000..63b192c858 --- /dev/null +++ b/lib/tasks/email_tos_update.rake @@ -0,0 +1,19 @@ +namespace :email do + task :tos_update => :environment do + puts "Emailing #{Publisher.count} users" + + Publisher.order(:id).find_each.with_index do |user, index| + begin + PublisherMailer.update_to_tos(user).deliver_now + print '.' if index % 1000 == 0 + rescue + # Let's rescue all exceptions + print "X" + Rails.logger.info "[#{Time.now.iso8601}] Could not send terms and conditions for [#{user.id}]" + end + end + + puts + puts "✨ Done" + end +end diff --git a/test/mailers/previews/publisher_mailer_preview.rb b/test/mailers/previews/publisher_mailer_preview.rb index 928dadbb15..302866d477 100644 --- a/test/mailers/previews/publisher_mailer_preview.rb +++ b/test/mailers/previews/publisher_mailer_preview.rb @@ -87,4 +87,8 @@ def tagged_in_note def email_user_on_hold PublisherMailer.email_user_on_hold(Publisher.first) end + + def update_to_tos + PublisherMailer.update_to_tos(Publisher.first) + end end