Problem/Motivation

We have many ECA email actions that builds recipient string for easy_email, by looping each email like this: [email]; [emails] where emails was initialized as an empty string in ECA. This results in a tailing semicolon and space. While I manage to change all semicolons to commas (thanks to the fix for issue 3254085 we can use comma separated emails reliably), it's cumbersome to add a tamper step for each email recipient string.

Steps to reproduce

Use the above ECA approach to build a to string like "a@example.com, b@example.com, ". Then the system will warn that " " is not a valid email.

Proposed resolution

While is is not an issue of the Symfony Mailer module, trimming the trailing space and comma is helpful for the above use case.

Let me create an issue fork for this one. I would appreciate it if you could consider using it.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hktang created an issue. See original summary.

hktang changed the visibility of the branch hktang-1.5.0-patch-83da to hidden.

hktang’s picture

Title: Trim trailing comma "to" string when it's a comma-separated string » Trim trailing comma and space in the "to" string
Issue summary: View changes
hktang’s picture

Status: Active » Needs review
adamps’s picture

Version: 1.5.0 » 2.x-dev
Status: Needs review » Needs work

Sure we could do that. All patches go into 2.x now please.

hktang’s picture

Thank you. I added a merge request against 2.x.

hktang’s picture

Status: Needs work » Needs review

  • adamps committed 45a946ee on 2.x authored by hktang
    Issue #3515427 by hktang: Trim trailing comma and space in the "to"...
adamps’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

hktang’s picture

I updated the MR so that we can use the patch for version 1.6.x.