Skip to content

feat/add-skip-delivery-flag - #7

Draft
Balasaheb-Dubale wants to merge 2 commits into
developfrom
feat/add-skip-delivery-flag
Draft

Balasaheb-Dubale wants to merge 2 commits into
developfrom
feat/add-skip-delivery-flag

Conversation

@Balasaheb-Dubale

@Balasaheb-Dubale Balasaheb-Dubale commented Apr 21, 2026 •

Copy link
Copy Markdown

Pull Request Template

Description

Change Summary

Problem

Creating outgoing messages via the Account API triggers SendReplyJob and EmailReplyWorker, causing real delivery to recipients (Twilio, Email, etc.). This blocks safe migration of legacy conversations into Chatwoot.

Solution

Added a skip_delivery guard to both delivery jobs. When content_attributes.skip_delivery is true on a message, delivery is silently skipped.

Files Changed

File Change
app/jobs/send_reply_job.rb Early return if skip_delivery is set
app/workers/email_reply_worker.rb Early return if skip_delivery is set
spec/jobs/send_reply_job_spec.rb Test: no delivery service called when flag is set
spec/workers/email_reply_worker_spec.rb Test: mailer not called when flag is set

Usage

Pass skip_delivery: true in content_attributes when creating migrated messages:

{
  "content": "Migrated message",
  "message_type": "outgoing",
  "content_attributes": { "skip_delivery": true }
}

Zero impact on normal flow

The flag key is absent from all standard message paths — agent replies, campaigns, automations, macros, and templates are completely unaffected.


Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Balasaheb-Dubale Balasaheb-Dubale self-assigned this Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant