feat: Add liquid processing for SMS campaigns (#10981)
Liquid template processing for SMS campaigns fixes: https://github.com/chatwoot/chatwoot/issues/10980 Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
@@ -60,5 +60,15 @@ describe Twilio::OneoffSmsCampaignService do
|
||||
sms_campaign_service.perform
|
||||
expect(campaign.reload.completed?).to be true
|
||||
end
|
||||
|
||||
it 'uses liquid template service to process campaign message' do
|
||||
contact = create(:contact, :with_phone_number, account: account)
|
||||
contact.update_labels([label1.title])
|
||||
|
||||
expect(Liquid::CampaignTemplateService).to receive(:new).with(campaign: campaign, contact: contact).and_call_original
|
||||
expect(twilio_messages).to receive(:create).once
|
||||
|
||||
sms_campaign_service.perform
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user