Search

Glad to hear everything is working!

And loving it! Nice work.

Thanks for the heads up, really appreciated!

So a tryed to use this to send a email to the user who fills the form:

<input name="etm[contato][recipient]" value="fields[email]" type="hidden" />

but as i undestood the recepient only accepts email values from authors, how could i send a email confirmation to the user and to the author?

obs: I didn´t get the antispan thing that you talked about in the other thread, will the next version of ETM have antispam built in it?

Deleted as not being relevant.

obs: I didn´t get the antispan thing that you talked about in the other thread, will the next version of ETM have antispam built in it?

The reason I didn not allow the recipient to be set in a frontend form is because anyone could send any email to a lot of people (spam!). For instance, imagine a contact form which includes a question.

A spammer could set the question to include things like: "viagra, valium buy here", but since he can also set the recipient he can use the form to send spam to everyone.

Ofcourse, this is not what we want, so using the frontend forms the recipient can only be a registered author of the website.

However, with the next version of ETM, which can be found on github (development branch, will be released soon!) the recipient is no longer set by the form, but in the backend. This will eliminate the spam point above, as you can choose the recipients.

Does this help?

OK i got now, will be waiting for the next release to try it out, thanks.

Email Template Manager updated to version 3.0 on 3rd of May 2011

1. What's new in this version?

  • Recipients are handled in the backend, so sending a confirmation email is possible.
  • Improved compatibility and useability with the Members extension.
  • Minor bugfixes in the backend (clicking utilities now works, amongst others)

2. If you were using a previous version:

Please beware the updating process is not as easy as hoped it would be.

Before you begin: backup your template files. The xsl files are still useable, the class files are useless because of the added features.

2.1. Updating

  • Remove all your templates from the email-templates directories.
  • Enable the Email Template Manager in the extensions menu to update the ETM.
  • Re-create your templates, including the new properties (recipients, reply-to). This will create a new class file.
  • Replace the new xsl layouts with your old xsl files from your backup.

Oh, competition? ;-)

Oh, competition? ;-)

MySQL Error (1072): Key column 'page_id' doesn't exist in table in query "CREATE TABLE IF NOT EXISTS `sym_etf_emails` ( `id` int(11) unsigned not null auto_increment, `html_page_id` int(11) not null, `text_page_id` int(11) not null, `xml_page_id` int(11) not null, `name` varchar(255) not null, `subject` text not null, `sender_name` text not null, `sender_address` text not null, `recipient_address` text not null, PRIMARY KEY (`id`), KEY `html_page_id` (`page_id`), KEY `text_page_id` (`text_page_id`), KEY `xml_page_id` (`xml_page_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;"

Not really..;)

On a serious note, I'd be interested to see how these all fit together. Are we in danger of having Email Template Filter, Email Template Manager and now Email Builder? I'm already completely lost as to which one I should use. Maybe I should wait for the development dust to settle a bit first.

On a serious note, I'd be interested to see how these all fit together. Are we in danger of having Email Template Filter, Email Template Manager and now Email Builder? I'm already completely lost as to which one I should use. Maybe I should wait for the development dust to settle a bit first.

Good point. I believe the ETF is being replaced with the Email Builder, so that would leave us with ETM and EB.

At this moment, both extensions provide roughly the same functionality, but with a very different foundation. The ETM uses its own templates to handle the xslt transformation, the EB uses pages.

By the way, I think having two extensions that are "competitors" will only increase the quality of the extensions.

By the way, I think having two extensions that are "competitors" will only increase the quality of the extensions.

Yep I don't dispute that. But remember the confusion we had when there were three or four member management extensions kicking around? Or the three fields we have that perform geocoding? Under the hood they are all very different, but when similarly-named it is very difficult for a first-time user to discern the difference and decide which to use, without installing and trying them all.

I'm not complaining — sending emails deserves some lovin'!

Hi Huib. Do you have any suggestions for how I could integrate this with Max's Paypal payments extension? Said extension outputs some XML as it updates the database with the Paypal IPN data.

Could an email template be triggered at this point as per Max's comment? If so, could you offer any guidance to a Symphony layman. Thanks

I think that as Symphony grows more end more popular, there will be more and more extensions that do the same things, it is just how things goes, look at joomla for example, there are tons of extension, and a lot of them do exactly the same thing as others, it´s just a matter of which one you feel comfortable working with.

I see Symphony as one of the most promising content management system around, and I enjoy going trough the extensions download page finding new ones and trying them out, even if they are similar to others.

This new ETM resolves one of my problems, which is the confirmation email, so thanks a lot, keep it up.

@stuart, I will need some time to get you a "working sample". How good are you with php? The ETM Api is rather easy to understand.

As a starting point, look at line 247 of events/event.paypal_payments_ipn.php, that would be the place to load your template and send it (using the core API).

You can use the following lines as a starting point for the ETM integration:

require_once(EXTENSIONS . '/email_template_manager/lib/class.emailtemplatemanager.php');
$template = EmailTemplateManager::load('YOUR_TEMPLATE_NAME');
$template->parseProperties();
$properties = $template->getParsedProperties();
$output = $template->render();

In this example, the $properties variable will contain: recipients, subject and reply-to. The $output variable will contain your html and plain layouts (if you are using both).

If you need more help on how to use this to actually send the email, take a look at the email API, or at the way I used it in the ETM itself.

This new ETM resolves one of my problems, which is the confirmation email, so thanks a lot, keep it up.

Thanks! If you have any suggestions or problems, please let me know!

Huib, I'm trying to build a notifications system where I'm using a refactored Forum extension to be able to send email messages when someone posts a comment in a discussion.

I was able to replace the Forum: New Comment event with a native Symphony event that uses the Email Template Manager to send a message. The problem is that there is a lot more going on with the Forum extension event, where the parent discussion gets updated and the extension database table for read discussions gets updated.

Is it possible to trigger the Email Template Manager filter within the context of the Forum: Discussions & Comments event?

Edit: I think I'll want the filter to fire only when a new comment is created.

Bauhouse, this might not be a direct solution to your problem, but it does show something problematic with the current implementation of events in Symphony. "Normal" events can have filters attached to them, which makes a lot of sense in a number of situations.

However, when it comes to custom events, this is no longer possible. This is bad news for my extension (amongst others) because it will require you to rewrite parts of the original event to use the filter - or to replicate its behaviour.

Back to you, bauhouse: you could use the same code posted above and insert it somewhere around line 275 of event.forum_post.php

Hi Huib. Thanks for this.

How good are you with php?

Sadly, not great. I'm a hacker, not a writer. So as a result, I'd be very grateful for a bit more help. The PayPal Payments extension outputs the IPN variables as XML. I presume I can use these values to populate my email template with the recipient email, the addressee name (for the email greeting), the quantity paid (referred to in the email) and the invoice number.

I believe the relevant chunk of XML looks like this:

<paypal-payments-ipn>
   <invoice>480</invoice>
   <first_name>Stuart</first_name>
   <last_name>Palmer</last_name>
   <payer_email>stuart@blah.com</payer_email>
   <mc_gross>15</mc_gross>
</paypal-payments-ipn>

My email template is setup with a standard subject "Thanks you for registering" and with the recipient as:

{/data/paypal-payments-ipn/first_name} {/data/paypal-payments-ipn/last_name} <{/data/paypal-payments-ipn/payer_email}>

My plaintext email template looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="text"
    omit-xml-declaration="yes"
    encoding="UTF-8"
    indent="no" />

<xsl:template match="/">
Dear <xsl:value-of select="/data/paypal-payments-ipn/first_name"/>,

Thank you for your entry to the Aquathlon Series. Your competitor number is <xsl:value-of select="/data/paypal-payments-ipn/invoice"/>.

You have paid - GPB <xsl:value-of select="/data/paypal-payments-ipn/mc_gross"/>

Happy swimming!

From all at South London Swimming Club
http://www.slsc.org.uk

</xsl:template>
</xsl:stylesheet>

So if I insert the code you quoted in the suggested position, it looks like it will build the email but won't send it. Are you able to tell me if I'm doing things right and how I can finish the send email loop? I have setup my Symphony build using the SMTP email gateway.

Thanks. Stu

However, when it comes to custom events, this is no longer possible. This is bad news for my extension (amongst others) because it will require you to rewrite parts of the original event to use the filter - or to replicate its behaviour.

True, it's not that difficult though to replicate. EventPreSaveFilter, EventPostSaveFilter and EventFinalSaveFilter. You'd be surprised how much code in the event __doit function is actually delegate based :)

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