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:
@@ -43,5 +43,14 @@ describe Sms::OneoffSmsCampaignService do
|
||||
assert_requested(:post, 'https://messaging.bandwidth.com/api/v2/users/1/messages', times: 3)
|
||||
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
|
||||
|
||||
sms_campaign_service.perform
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user