Views list token not working for recipients

Created on 19 February 2024, about 1 year ago

Sending emails to a Views list via token

I currently have a View that lists the emails of a group's members. I use this in an ECA model, as a token, to send out emails. This currently works and successfully sends mail out to each member of the group. However, these emails are only plain text, and I want to improve that, so I have installed Symphony Mailer and Easy Emails.

Steps to reproduce

I added a new Easy Email template.

I then set up an ECA model that:
- triggers on an entity insert of a specific type
- sets user to 1
- sets a token, with the values from the Views email list, called [mails]
- striptags and trim whitespace on [mails] and outputs a new token [cleanmails]
- create an Easy Email template entity
- I have tried setting the entity field value of "cc_address" here. A specific value works, but if I use the token instead it fails
(Error sending email: Email "" does not comply ...)
- Send an Easy Email, using the above entity IF I have an actual email address set. Fails otherwise.

Current Result

When I use the [cleanmails] token in the Email Template, in either To: or CC: fields, it does not render the token. It gives the same blank email error as when I set the value via the ECA model.

Using this token in the body field works absolutely perfectly and displays a list of comma separated email addresses exactly as expected.

Since the token works in the body, I know it is a valid output. Since it does not work for the recipient or cc fields, is there some extra step I am missing? I am hopeful that someone can enlighten me.

Thank you so much.

πŸ’¬ Support request
Status

Active

Version

3.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States lifeontheshore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @lifeontheshore
  • πŸ‡ΊπŸ‡ΈUnited States zengenuity

    What does the value look like when you render [cleanmails]? Is it comma-separated values or something else? It's possible we might be stripping HTML out of cc_address, so if your output has HTML that could be the issue.

  • πŸ‡ΊπŸ‡ΈUnited States lifeontheshore

    It is a comma separated list.

    The ECA log shows:

    - emails (DTO "<div class="views-element-container"><div class="view view-family-member-views view-id-family_member_views view-display-id-block_28 js-view-dom-id-ae133ef6d918cc1ae0558e9cfa4451ef8e9af1a4d59994b9ab222d0012776f51"> <div class="view-content row"> <div> john@sample.com, </div> <div> teresa@sample.com, </div> <div> janet@sample.com, </div> <div> jason@sample.com, </div> </div> </div> </div> ")
    - strippedemails (DTO " john@sample.com, teresa@sample.com, janet@sample.com, jason@sample.com, ")
    - cleanmails (DTO "john@sample.com, teresa@sample.com, janet@sample.com, jason@sample.com,")

    Using an actual email address in the To field with the [cleanmails] token in the Body field of the email template sends this:

    john@sample.com, teresa@sample.com, janet@sample.com,
    jason@sample.com,
  • πŸ‡ΊπŸ‡ΈUnited States zengenuity

    The cc_address field is a multi-valued string field. It expects an array of strings, with one address in each string. Is there any way to get ECA views to provide that format of data?

Production build 0.71.5 2024