Search

Ah. The second option looks the most elegant. Thanks!

Email Template Manager updated to version 2.1 on 5th of April 2011

Security warning

This version 2.1 fixes a very dangerous bug. All users of this extension should update their extension as soon as possible.

This version 2.1 fixes a very dangerous bug

Like, rapist on the loose dangerous?

Like, rapist on the loose dangerous?

Yes, that is the kind of things you should be thinking about.

No, seriously, bad things are possible - deleting data, sending spam, adding users / changing passwords, that kind of stuff.

I just realized that I can't create a message that refers back to the ID of the entry that was just created. The id attribute gets stripped from the event XML:

<data>
 <events>
   <send-message>
     <post-values>
       <email>bot@example.com</email>
       <name>Allen Bot</name>
       <subject>Subject</subject>
       <message>Message</message>
     </post-values>
   </send-message>
 </events>
</data>

So, I'm not able to include a message like this:

Log in as a site author/administrator to view the message here:
<xsl:value-of select="concat($root, '/symphony/publish/contact-form/edit/', /data/events/send-message/@id, '/')" />.

Confirmed. But as far as I remember, it would be too hard to include this (because the extension has to re-build Symphony's event XML during template execution.)

But there is a solution, and it's called $etm-entry-id.

This parameter is added to the param pool, so you can not only use it in XSLT, but even filter datasources! That's cool, isn't it? (Obviously Huib forgot to add it to the README, so feel free to submit a bug report for the README on Github!)

BTW: The extension may break upon sending in Symphony 2.2 if the event name contains spaces. So if you are testing this extension, please use Symphony's integration code from Github. (Extension compatibility should probably be changed to Symphony 2.2.1 when it has been released.)

Obviously Huib forgot to add it to the README

Oops, I sure did..

I will update the readme next week (when I have the time).

I will update the readme next week (when I have the time).

Maybe you can add the compatibility hint as well. No need to hurry, however. I will watch this forum thread and try to help if I can.

@Stephen: I am sure you would find this without any help, but maybe I can save you some minutes of work:

Using the $etm-entry-id parameter you are able to filter your datasource and receive the new entry that has just been created. This also means that in your email template you can have more than just the post-values to play with! It is, for example, possible to have a "Markdown-enabled" textarea in the frontend and email the HTML version by outputting the formatted content of the field in your template's datasource.

Thanks! The $etm-entry-id parameter worked great. I can see how this could be very useful for filtering.

Email Template Manager updated to version 2.2 on 15th of April 2011

Is it possible to send a confirmation email to whom filled the form? knowing that they would not be users?

This is not possible using the auto-generated event filters of the ETM extension, because these filters don't support "CC" header fields. You may, however, write a custom event and use the core email API directly. I am afraid that the developer documentation of the core email API has not yet been released on the Symphony website, so take a look here:

https://github.com/michael-e/core-email-api-docs/blob/master/developer-documentation.markdown

Another, more simple solution would be to use both addresses as recipients (which will mean that both will be in "To", so there is no "CC", but the result is nearly the same... But you would need the development branch of the extension and make use of the $etm-entry-id parameter as described in the above comments.

Is it possible to send a confirmation email to whom filled the form? knowing that they would not be users?

With the next release: yes. The codebase of this new version is stable, but I have not yet finished the documentation, so I haven't released it yet. However, you can always download it from github.

Also, keep in mind that if you are updating, your old template class files can cause problems.

@Michael, it is possible. Just create two different templates: one for the developer: 'a new entry is posted', and one for the end-user: 'your question has been received, we will look at it'.

Then you can use the $etm-entry-id as you described to send one email to the user, and hard-code the other template with your own email (or username).

@Michael, it is possible

Yes, nice idea! But still it's not exactly what "CC" does, it's more like a "BCC simulation". :-)

Click Preview for a plain template and get error on 135 of /email_template_manager/lib/class.emailtemplate.php

throw new EmailTemplateException('Error compiling xml with xslt: ' . $error[1]['message']); 

Can you please share your error message?

It looks like you have an error in your template file, can you include that aswell?

Can you please share your error message?

Error compiling xml with xslt:

It looks like you have an error in your template file, can you include that aswell?

It doesn't like <xsl:copy-of select="//post-values" />. Email sent fine. I was just using it to test. Actual XSLT works great!

@Lewis, thanks for the reminder, I should fix the error messages to show the same as the regular pages with XSL errors.

Glad to hear everything is working!

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