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

@@ -22,7 +22,8 @@ class Sms::OneoffSmsCampaignService
campaign.account.contacts.tagged_with(audience_labels, any: true).each do |contact|
next if contact.phone_number.blank?
send_message(to: contact.phone_number, content: campaign.message)
content = Liquid::CampaignTemplateService.new(campaign: campaign, contact: contact).call(campaign.message)
send_message(to: contact.phone_number, content: content)
end
end