gab-social/app/workers/introduce_account_pro_worker.rb
mgabdev a4add61342 Added emails for new users who arent PRO
• Added:
- emails for new users who arent PRO
2020-09-18 22:49:15 -05:00

22 lines
421 B
Ruby

# frozen_string_literal: true
class IntroduceAccountProWorker
include Sidekiq::Worker
sidekiq_options queue: 'mailers', retry: 2
attr_reader :user
def perform(acct_id, date_range)
@acct = Account.find(acct_id)
deliver_email(date_range)
end
private
def deliver_email(date_range)
UserMailer.introduce_pro(@acct.user, date_range).deliver_now!
@acct.user.touch(:last_emailed_at)
end
end