Skip to content

Document sendToDnc field and Send Email to Contact API behavior#498

Open
promptless-for-oss wants to merge 8 commits into
mautic:7.0from
Promptless:promptless/pr-16039-send-to-dnc-api
Open

Document sendToDnc field and Send Email to Contact API behavior#498
promptless-for-oss wants to merge 8 commits into
mautic:7.0from
Promptless:promptless/pr-16039-send-to-dnc-api

Conversation

@promptless-for-oss
Copy link
Copy Markdown
Contributor

Open this suggestion in Promptless to view citations and reasoning process

Documents the new sendToDnc boolean field on the Email entity, including the email:emails:sendtodnc permission required to set this field via API, the PUT behavior defaulting to false, and how the Send Email to Contact endpoint now respects this setting for Do Not Contact handling instead of always treating API-sent emails as transactional.

Trigger Events


Tip: Send Promptless a meeting transcript in Slack to generate doc updates 📝

promptless Bot added 7 commits April 17, 2026 13:16
Document the new sendToDnc boolean property that allows sending Emails
to Contacts with UNSUBSCRIBED or MANUAL Do Not Contact status while
still respecting BOUNCED status.
Documents the email:emails:sendtodnc permission required to set the
sendToDnc field via API, and clarifies that PUT requests default
this field to false when not explicitly provided.
Document how the endpoint respects the Email's sendToDnc setting for
Do Not Contact handling when sending to individual contacts via API.
Comment thread docs/rest_api/emails.rst
* - ``grapesjsbuilder``
- associative array
- Associative array of Email builder configuration
* - ``sendToDnc``
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added sendToDnc field documentation based on PR #16039 which adds the sendToDnc property to Email.php with API exposure via #[Groups(['email:read', 'email:write'])] annotations.

Source: mautic/mautic#16039

Comment thread docs/rest_api/emails.rst
- boolean
- When ``true``, the Email sends to Contacts with UNSUBSCRIBED or MANUAL Do Not Contact status, while still respecting BOUNCED status. Defaults to ``false``.

**Permission:** Requires the ``email:emails:sendtodnc`` permission to set this field via API. If the authenticated User lacks this permission, the API ignores the ``sendToDnc`` parameter.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added permission requirement (email:emails:sendtodnc) documentation and PUT behavior note based on EmailApiController.php changes in PR #15995. The controller's processForm method strips the sendToDnc parameter if the user lacks permission, and defaults it to false for PUT requests.

Source: mautic/mautic#15995

Comment thread docs/rest_api/emails.rst

``POST /emails/ID/contact/CONTACT_ID/send``

Do Not Contact behavior
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added Do Not Contact behavior section because EmailApiController::sendLeadAction() changed from always setting ignoreDNC: true to using $entity->getSendToDnc(), meaning the endpoint now respects the Email's sendToDnc setting instead of treating all API-sent emails as transactional.

Source: mautic/mautic#15995

Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@promptless-for-oss please address the suggestions

Comment thread docs/rest_api/emails.rst
Comment thread docs/rest_api/emails.rst Outdated
@adiati98 adiati98 added this to the 7.2 milestone May 31, 2026
Wrap the "Do Not Contact behavior" heading and sendToDnc bullet points
with vale off/on directives as requested by @adiati98.
@promptless-for-oss
Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've applied both suggestions:

  1. Added .. vale off / .. vale on directives around the "Do Not Contact behavior" section heading
  2. Added the same Vale directives around the sendToDnc bullet points, and updated the formatting to use - **default**

The changes have been pushed to the PR branch.

@adiati98 adiati98 requested a review from escopecz May 31, 2026 13:53
Copy link
Copy Markdown
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good 👍

@escopecz
Copy link
Copy Markdown
Member

escopecz commented Jun 1, 2026

But it should be rebased to the 7.2 branch once available.

@promptless-for-oss
Copy link
Copy Markdown
Contributor Author

Understood! I'll rebase this PR to the 7.2 branch once it's available in the repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants