fix: Error shouldn't halt the campaign for entire audience (#11980)

## Summary
- handle Twilio failures per contact when running one-off SMS campaigns
- rescue errors in WhatsApp and generic SMS one-off campaigns so they
continue
- add specs confirming campaigns continue sending when a single contact
fails

fixes:  https://github.com/chatwoot/chatwoot/issues/9000

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Sojan Jose
2025-08-10 23:33:48 -07:00
committed by GitHub
parent 8ea21eeefd
commit 3214d06a83
6 changed files with 70 additions and 8 deletions

View File

@@ -29,5 +29,7 @@ class Sms::OneoffSmsCampaignService
def send_message(to:, content:)
channel.send_text_message(to, content)
rescue StandardError => e
Rails.logger.error("[SMS Campaign #{campaign.id}] Failed to send to #{to}: #{e.message}")
end
end