We are trying to reset the flags field in a way that allows us to ensure that bit 2 and either 4 or 10 are set. If this is not the case, we "repair" the value and send notification emails, one to the logged-in user and one to the administrator.
The new flag values are successfully written to the database, and the emails are sent. However, when a user is working in the mailing wizard, which is usually the case, and proceeds to the next panel (active_pane), the flags are reset to the undesired state.
Since there does not appear to be a suitable hook, such as a mailing pre-send hook, we do not see a way to implement this using hooks.
A one-minute guard process is not a viable solution either. Even if we only apply the fix on screen 4 (active_pane), where the user can click Send Mailing, some users do not remain on that screen long enough for the guard to run.
Is there a better way to achieve the desired behavior?
Perhaps there is a way to disable these selections altogether, or remove some of the available options.
We also tried renaming the options, but that did not have the desired effect.
https://community.superoffice.com/en/technical/forums/product-forums/crm-web-application/how-to-translate-string-sr_admin_lists_useourcontact/
But perhaps you'll find another way.
All Replies (2)
The mailing/marketing module will indeed overwrite the state of the mailing being created when switching between the panes, based on its own settings. There currently is no way to do what you want, since there are no CRMScript of webhook triggers for the shipment/mailing entity. Maybe in the future 😃
Hi Mathias,
David is right, and here's why patching `flags` from outside can't work.
Why the value keeps resetting
The From and Reply-To choices in the mailing wizard are built into the wizard itself. Each time the mailing is saved, which includes every pane change, the wizard clears all the From and Reply-To bits in `flags` and sets them again from what's selected in the dropdowns. Anything written to the database in between is overwritten. For the same reason there's no table, list or admin setting where these options are stored, so changing data in the database won't remove or disable them.
What are you trying to achieve?
As I read it, you want From = sales contact (bit 2) and Reply-To = the address entered in the mailing (bit 4) or no Reply-To (bit 10). What's the requirement behind that? Is it:
1. Mailings must never be sent from, or have replies routed to, addresses outside your own domains (deliverability, SPF/DKIM/DMARC, spoofing), or
2. A policy that users must not be able to choose "Our contact" or similar at all?
If it's (1), there's a built-in feature for this
Turn on the system-wide preference Marketing → "Only use approved e-mail sending domains" and add your domains to the list Mailing Domains under Lists.
With this on:
- The From and Reply-To fields in the wizard only accept addresses on your approved domains.
- When Sales contact or Our contact is chosen, the address is resolved per recipient at send time. If that person's e-mail isn't on an approved domain, the mailing falls back to the From/Reply-To address entered in the mailing.
Because this check runs when the mailing is sent, the wizard can't undo it, so you don't need a guard process or notification e-mails.
It's a domain allowlist. It doesn't hide the dropdown options, and a user can still pick Our contact if that person has an address on an approved domain.
If it's (2)
That isn't possible today. Letting administrators restrict which From/Reply-To options are available would need a product change. If that's what you need, please describe your use case so we can consider it.
Best regards
Hi Mathias,
Thanks, that makes the use case clear, and it's a reasonable one. Steering marketing mail to shared mailboxes shouldn't depend on users picking the right option every time.
To confirm: it isn't possible today. The From and Reply-To options are built into the mailing wizard, and there's no preference, list or translation setting that removes or disables them. The same options are also offered in e-mail flows.
I've registered this as a feature request with the Marketing team. The proposal is a system-wide setting that lets administrators turn off the person-based options ("our contact" / "support contact") for both From and Reply-To, in mailings and in flows. That would leave only the address entered in the mailing, or an empty Reply-To.
I can't promise a release or timeline, as that depends on the team's planning. Your description of the problem (replies and unsubscribe requests ending up in regional managers' mailboxes) is included in the request, which helps.
Until then, "Only use approved e-mail sending domains" won't help in your case, as you noted. The only safeguard left is internal guidance for the marketing team.
Best regards
Hi Tony, appriciate that,
can you add this ticket to the PR, maybe i'll get a email if and when it ships (I will have surly forgotten about that^^).
Well, thought about adding newsletter only domain, but that ist a hassle we actually do not want to have to be honest.
And I am not sure right now if that would help, but it could.
Actually, I am not excaclty sure if that 'don't reply the manager' also shall or shall not be dependend on the newsletter type,
maybe some marketing replies shall go to regional Manager (regional expo attendance) and others shall not.
Maybe this is not black and white, but with some admin options, the customer would have that headace, not (only) us.
(But maybe we can at least propese that newsletter-domain.com to the Customers facing this issue, I have to think about that)
Anyways, thanks again for the fast response, you can close this ticket fpor now,
Cheers, Mathew