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:
Michael Choi
2025-06-11 12:16:44 -05:00
committed by GitHub
parent 7a67799f35
commit 68bfbc7eb0
6 changed files with 156 additions and 2 deletions

View File

@@ -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