#16491·mautic

Segment email translations are broadcast independently, sending the translated version to contacts regardless of preferred locale

Author: introfiniCreated Jul 9, 2026Updated Sep 24, 2026
Q A
Mautic version 7.0.x (also verified by code inspection on current 7.1.0-rc head)
PHP version 8.3

Summary

When a segment email has a translation, the mautic:broadcasts:send command processes the translation child as its own independent broadcast. Because of how the per-broadcast language map is built, the child broadcast sends the translated version to every pending contact in its batch, regardless of preferred_locale (even contacts whose locale matches the parent's language). Which language a contact receives ends up being a race between the two broadcast jobs, not a function of their locale.

The documented behaviour is: "if a contact has a preferred language set, they receive the translated version in their preferred language if it exists, otherwise they receive the parent in the default language."

Steps to reproduce

  1. Create segment email A (language en), assign segment S, publish.
  2. Create segment email B as a translation of A (language pt_PT), publish. (Saving forces B to inherit A's segments — EmailModel::saveEntity().)
  3. Ensure S is larger than the broadcast batch limit, so neither broadcast drains the segment in one run.
  4. Let the mautic:broadcasts:send cron run.

Expected: contacts with preferred_locale starting with pt receive B; everyone else (including contacts with an empty preferred_locale) receives A.

Actual: contacts processed under A's broadcast behave as expected, but contacts processed under B's broadcast all receive B — including contacts with an empty preferred_locale and even contacts with preferred_locale = en. On a real send to ~24k contacts (few of which had preferred_locale set), 19,241 received the pt_PT translation and only 4,667 received the en parent.

No duplicates occur (the pending query excludes contacts with a stat on any related translation id), which hides the problem: every contact gets exactly one email, just in an arbitrary language.

Root cause (3 interacting pieces)

  1. EmailRepository::getPublishedBroadcastsQuery() (app/bundles/EmailBundle/Entity/EmailRepository.php) only filters on published-by-date + emailType = 'list'. It does not exclude emails that have a translationParent, so the translation child is picked up as a separate broadcast targeting the same segments.

  2. EmailModel::sendEmail() (app/bundles/EmailBundle/Model/EmailModel.php, "Group contacts by preferred locale" block): contacts with an empty preferred_locale fall through to $details['languages']['default'], and default is the id of the email currently being broadcast (getEmailSettings()). Under the child's broadcast, "default" is the translation, not the parent.

  3. getEmailSettings() builds the language map from $email->getTranslations(true), which returns only the children of the translation parent (TranslationEntityTrait::getTranslations()). When the email being sent is the child, the resulting map is ['default' => childId, '<childLocale>' => childId] — the parent's language is absent, so even contacts whose preferred_locale matches the parent's language receive the child.

Suggested fix

Exclude translation children from the broadcast query, e.g. in getPublishedBroadcastsQuery():

php
$expr->add(
    $qb->expr()->isNull($this->getTableAlias().'.translationParent')
);

With only the parent processed as a broadcast, the existing locale grouping in sendEmail() routes translations correctly (matching locale → child, everything else → parent), which matches the documented behaviour. The auto-unpublish check ("no more pending contacts") would also then apply to the family as a whole via the parent.

Related (but distinct) reports: #6395 (campaigns don't auto-select translations), #8629 / #11586 (marketing-email dedupe not evaluating translations).



Care about this issue? Want to get it resolved sooner? If you are a member of Mautic, you can add some funds to the Bounties Project so that the person who completes this task can claim those funds once it is merged by a member of the core team! Read the docs here.