-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send out referral and identity update (#2247)
- Loading branch information
Cory McDonald
authored
Sep 23, 2019
1 parent
9f6b5f6
commit e764140
Showing
9 changed files
with
77 additions
and
169 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
module Batch | ||
class EmailUpdateToUserJob < ApplicationJob | ||
queue_as :low | ||
|
||
def perform(publisher_id:) | ||
publisher = Publisher.find(publisher_id) | ||
return if publisher.suspended? | ||
|
||
BatchMailer.notification_for_kyc(publisher).deliver_now | ||
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 |
---|---|---|
@@ -1,18 +1,11 @@ | ||
# Used for designating batch jobs, usually to all publishers - thus we should queue as low | ||
class BatchMailer < ApplicationMailer | ||
def update_to_tos(publisher) | ||
def notification_for_kyc(publisher) | ||
@publisher = publisher | ||
mail( | ||
to: @publisher.email || @publisher.pending_email, | ||
subject: default_i18n_subject | ||
) | ||
end | ||
path = Rails.root.join("app/assets/images/mailer/batch/referral.png") | ||
image_file_name = File.basename(path) | ||
attachments.inline[image_file_name] = File.read(path) | ||
|
||
def update_to_rates(publisher) | ||
@publisher = publisher | ||
mail( | ||
to: @publisher.email || @publisher.pending_email, | ||
subject: default_i18n_subject | ||
) | ||
mail(to: @publisher.email || @publisher.pending_email, subject: default_i18n_subject) | ||
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,26 @@ | ||
p.salutation= t "publisher_mailer.shared.salutation", name: @publisher.name | ||
|
||
p We have some changes occuring on October 1st, 2019 that you should know about. | ||
p | ||
span 1. Did you know you can earn BAT by referring your audience and other users to install Brave? It’s true! Be sure to log into your creator dashboard to find your code. | ||
= image_tag(attachments["referral.png"]&.url, alt: 'A picture showing how to access your referral link', style: "width:100%; height:auto; border:none;") | ||
p | ||
span September 30th, 2019 will be the last day for a user to install Brave and receive the old rate of $5 BAT equivalent. Afterward, there will be a new rate that depends upon the location of the installer. | ||
a href="https://support.brave.com/hc/en-us/articles/360025284131"= " Check here for the updated rate card." | ||
|
||
p 2. For those of you who have been actively promoting Brave, we are introducing a promoter program that will help you manage referral codes and campaigns. The promoter program will be invite-only at launch, but we will be bringing in our most active promoters to preview the system over the next few weeks. | ||
|
||
p | ||
span 3. Lastly, please take this quick survey and read the next paragraph! | ||
a href="https://www.surveymonkey.com/r/HNFJKVV"= " https://www.surveymonkey.com/r/HNFJKVV" | ||
|
||
p | ||
span If you visit our community or social media pages, you may have noticed that we’ve reached out regarding KYC and connecting your account with Uphold. Starting October 1st, 2019, | ||
strong=" if you do not create and verify your account with Uphold including Uphold Verified Membership, you will not be able to receive direct tips from Brave user funds. " | ||
span A user who attempts to tip a non-verified publisher will not be able to do so, and the BAT will not leave their wallet. We highly recommend that you log into your Creator dashboard and connect your Uphold account as soon as is possible. | ||
|
||
p | ||
span If you have any questions, please join the discussion at | ||
a href="https://community.brave.com/c/brave-rewards/publishers"= " https://community.brave.com/c/brave-rewards/publishers" | ||
|
||
p As always, thank you for coming on this journey with us! |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
namespace :email do | ||
task :kyc_and_referral_update, [:id ] => :environment do |t, args| | ||
|
||
publisher = Publisher | ||
if args[:id].present? | ||
publisher = publisher.where("id >= ?", args[:id]) | ||
end | ||
|
||
puts "Emailing #{publisher.count} users" | ||
publisher.order(id: :asc).find_each.with_index do |user, index| | ||
begin | ||
next if user.email.blank? && user.pending_email.blank? | ||
|
||
Batch::EmailUpdateToUserJob.perform_later(publisher_id: user.id) | ||
|
||
print '.' if index % 1000 == 0 | ||
rescue => ex | ||
puts | ||
puts "Rescued from exception: #{ex.message}" | ||
puts "Could not send email to #{user.id} - Restart the job by running the following" | ||
puts | ||
puts " rake email:rate_changes[\"#{user.id}\"]" | ||
break | ||
end | ||
end | ||
|
||
puts | ||
puts "Done" | ||
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