Add CampaignCreationEmailFollowupJob
This commit is contained in:
parent
211317f05f
commit
7b4b4573b0
3 changed files with 7 additions and 31 deletions
7
app/jobs/campaign_creation_email_followup_job.rb
Normal file
7
app/jobs/campaign_creation_email_followup_job.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
class CampaignCreationEmailFollowupJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(campaign)
|
||||
CampaignMailer.creation_followup(campaign).deliver_now
|
||||
end
|
||||
end
|
|
@ -1,16 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module JobTypes
|
||||
class CampaignCreationFollowupJob < EmailJob
|
||||
attr_reader :campaign
|
||||
|
||||
def initialize(campaign)
|
||||
@campaign = campaign
|
||||
end
|
||||
|
||||
def perform
|
||||
CampaignMailer.creation_followup(@campaign).deliver
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,15 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
require 'rails_helper.rb'
|
||||
|
||||
describe JobTypes::CampaignCreationFollowupJob do
|
||||
describe '.perform' do
|
||||
it 'calls the correct active mailer' do
|
||||
expect(CampaignMailer).to receive(:creation_followup).with(1).and_wrap_original { |_m, *_args| mailer = double('object'); expect(mailer).to receive(:deliver).and_return(nil); mailer }
|
||||
|
||||
job = JobTypes::CampaignCreationFollowupJob.new(1)
|
||||
job.perform
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue