Search

Hello, I'm a big fan of the ETM extension and use it on every members site I have. I've gotten quite used to using it and it allows so much flexibility I haven't found a lot yet it cannot do. However, I'm trying to figure out a solution for a particular problem I'm having.

During set-up, currently it is possible to have the email sent to multiple recipients. The format generally looks like this:

Recipients: email@domain.com, email@domain.com

or

Recipients: {/data/entry/email1}, {/data/entry/email2}

But I'm wondering if its possible to have multiple dynamic recipients? Where I could customize at the time of sending who should receive this email based on the context it is in.

Is it possible to just use a variable or XSL to do this? Like this?

Recipients: {$all-relevant-recipients}

or

Recipients: {/data/entry/emails}

Where those variables would equal email@domain.com, email@domain.com?

If so, what's the best way to create a variable on the fly like that? If not, is there another way of accomplishing this? Thanks!

AFAIK, for ETM it is not possible to send to an unknown number of recipients, because larger numbers of recipients need some special features provided by the Email Newsletter Manager (ENM) extension. (However, you would have to write your own event which talks to the ENM's API.)

But I admit that I never tried this with ETM alone. You might examine the code and see if you can do what you want. Or you might as well use the ETM's API in a custom event.

@creativedutchmen: Please correct me if I am wrong.

Was thinking about using Parametrisator to try and create a variable on the fly which then I could feed in there. I'll have to give that a go.

Would still love to hear from creativedutchmen if he's around...

It sure is possible, and in exactly the way you imagined it. You can even use the NAME <EMAIL> syntax here, it will be expanded automatically.

Do keep in mind though the remark made by Michael: if you are going to send the email to more than a handful of people (say, 5-6) things will get very slow, as your user has to wait for each of these emails to be sent.

edit: the correct syntax would be {path/to/recipients} with the xpath matching more than one node. The single variable approach might not work, but I am not sure.

Exciting! Yeah, I don't think it would ever be used to send a lot of emails, probably 1-6. So, just to clarify. If I have XML kinda like this:

<section-name>
     <entry>
         <email>somebody@whatever.com</email>
      </entry>
     <entry>
         <email>another@whatever.com</email>
      </entry>
     <entry>
         <email>onemore@whatever.com</email>
      </entry>
</section-name>

Then I could reference it like this?

Recipients: {section-name/entry/email}

I think so, yes. If that doesn't work you could also try {section-name/entry}.

Hi,

I updated ETM to send POST data so you use a custom datasource for multiple recipients.

https://github.com/korelogic/emailtemplatemanager

Can you explain how to do this then? It's not too obvious without an example.

An example form:

<form>
<input name="fields[name]" />
<input name="fields[phone]" />
<input name="fields[yourDSFilter]" type="hidden"/>
<form>

The post data is sent through to the event and you can filter your datasources attached to the ETM event on any of these parameters.

$etm-entry-id
$etm-post-name
$etm-post-phone
$etm-post-yourDSFilter

Quite interesting. Can you send a pull request to @creativedutchmen's development branch? I would then test it and (suggest to) merge it—if I can't break it. :-)

@korelogic that sounds AMAZING, what ETM always needed. I assume the fields don't have to be entry fields? Now we can send emails without creating new entries?

I already sent a pull request to master a while ago. Just sent one to the development branch.

https://github.com/creativedutchmen/emailtemplatemanager/pulls

Yes you can send emails without creating a new entry but may need to customise the event.

Give me some days, I will have to do some tests with the ETM anyway during the weekend.

Whatever came of the pull request from @korelogic? I see it listed on the repo as a pull request but it doesn't look to have been pulled into the development or master branches.

As a small sidenote I think the version mentioned in the README just needs updating to v5.

That pull request is still in my inbox. I just didn't find the time to evaluate it.

The version number (I filed an issue for that) might as well be removed completely. Or would anybody need this info in the README?

No worries. I might have a use for it on a current project so let me know if you find that it's good enough to pull in to the master branch. It sounds like a useful addition.

Re: the version number, I agree. It doesn't really need to be in the README. The version info is pulled in from the repo via symphonyextensions.com so that's a more dynamic way of keeping track.

From what I've seen in the pull request nothing can possibly break there. So if @michael-e is on board I think we can safely pull this thing :)

I merged the pull request, removed the version number from the README and released version 5.1. Happy mailing everybody.

I'm trying the same approach with ETM 7.1.1, but I don't receive the e-mails.

Based on a select box with locations I fill a hidden field with 2 or 3 names which are authors. In the recipients field from ETM I have {/data/form-transport-request/entry/recipients} The datasource shows the names also: (<recipients handle="plenaforma-rudy">plenaforma, rudy</recipients>), but e-mail isn't send.

Anything in the Symphony log file?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details