Skip to content

feat: allow changing recipients when resending a mail - #153

Draft
shyim wants to merge 2 commits into
mainfrom
cursor/resend-change-receiver-249a
Draft

shyim wants to merge 2 commits into
mainfrom
cursor/resend-change-receiver-249a

Conversation

@shyim

@shyim shyim commented Sep 21, 2026

Copy link
Copy Markdown
Member

Closes #143

What

Clicking Resend mail on the mail archive detail page now opens a modal that is pre-filled with the current recipients. The recipient list can be adjusted — e.g. to fix a typo in the e-mail address, which is the most common reason a mail could not be delivered — before the mail is actually resent.

How

Backend (MailArchiveController::resend)

  • The resend-mail API action accepts a new optional receiver parameter: a non-empty list of e-mail addresses, each either a plain address or in Name <mail@example.com> format (parsed via Symfony\Component\Mime\Address::create()).
  • When provided, the To header of the rebuilt email is replaced before sending — works for both the EML-based and the database-based rebuild path.
  • Invalid input is rejected with a 400 response (MAIL_ARCHIVE__PARAMETER_INVALID_RECEIVER).
  • Without the parameter, behavior is unchanged (used by the list page quick/bulk resend actions).

Administration (detail page)

  • The toolbar button now opens a sw-modal with a sw-tagged-field pre-filled with the current recipients (keeping their display names), a cancel and a confirm button.
  • Confirming resends with the adjusted recipients; on validation errors the modal stays open so the address can be fixed.
  • New en-GB/de-DE snippets for the modal.

Note on the help text snippet

The example address in the help text escapes the @ as {'@'}: a bare @ inside a message is parsed as vue-i18n linked message syntax and makes the message compiler throw (INVALID_LINKED_FORMAT), which prevented the modal from rendering. This was verified against the vue-i18n 9 (Shopware 6.6) and 10 (Shopware 6.7) runtimes.

Testing

Verified on a real Shopware 6.7.14 installation with the plugin installed:

  • Resend with corrected address via API: original mail marked resent, new archive entry created with the corrected receiver, display name preserved, source_mail_id linked to the original mail.
  • Resend with invalid address: 400 MAIL_ARCHIVE__PARAMETER_INVALID_RECEIVER.
  • Resend without receiver parameter: unchanged behavior (backwards compatible).
  • Full UI flow in the administration (see recording): modal opens pre-filled with Max Mustermann <max.mustermann@exmaple.com>, address corrected to max.mustermann@example.com, resend succeeds, resend history shows the new sent entry.
  • phpstan level max passes against shopware/core ~6.6.0 and ~6.7.0; administration JS passes the shopware-cli prettier config; snippet key parity between en-GB and de-DE verified (CI check-snippets).

Resend modal pre-filled with current recipient

Success notification and updated resend history

resend_modal_change_recipient_flow.mp4

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 21, 2026 04:34
The resend-mail endpoint now accepts an optional receiver parameter
(list of e-mail addresses, optionally in "Name <mail@example.com>"
format). When provided, the To header of the rebuilt email is replaced
before sending. Invalid addresses are rejected with a 400 error.

Refs: #143

Co-authored-by: xai <xai@shyim.de>
Clicking "Resend mail" on the mail archive detail page now opens a
modal pre-filled with the current recipients, so the e-mail address can
be corrected (e.g. typos) or replaced before resending. Confirming the
modal sends the adjusted recipient list to the resend-mail endpoint.

Note: the example address in the help text snippet escapes the @ sign
as {'@'} because a bare @ is parsed as vue-i18n linked message syntax
and breaks message compilation.

Closes: #143

Co-authored-by: xai <xai@shyim.de>
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.

Possibility to change e-mail adress when resending

2 participants