Skip to content

Add "use original recipients" option to resend email dialog #95

Description

@solverat

EmailController::resendEmailAction resend an email by loading the recipients from the Email\Log entry and then calling Mail::setDocument() with the original mail document. If that document was created by the form builder, its to/cc/bcc/from/replyTo fields can contain placeholders like %fieldname%, which are only resolved against form submission data at send time and are
never persisted back to the document.

On resend there is no form data available, so setDocument() re-adds these unresolved placeholder strings as recipients on top of (or in place of, for from) the correct addresses already stored in the log, resulting in broken or duplicated recipients.

BC

Always preferring the log's recipients over the document's current fields would be a breaking change: some templates use static, non-placeholder addresses in the document, and an admin may have intentionally edited those fields since the original send, expecting a resend to pick up the change.

Proposed solution

Add a checkbox to the resend and forward confirmation dialog: "Use original recipients."

  • Unchecked by default: current behavior, recipients are taken from the mail document.
  • If the mail document contains unresolved placeholder fields (e.g. %fieldname%), the checkbox is automatically checked and set to read-only, with a short help text explaining why, since the document fields cannot be used safely in that case.
  • Admins can also check it manually to force using the log's original recipients.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions