Search

This is the same error that i recieve when i try to preview layouts.

My HTML emails do not get sent, but the plain text ones do...

Your problem is right here: <xsl:import href="workspace/utilities/admin-email.xsl"/>.

The template lives in the workspace/email-templates directory, and it is looking for the admin-email utility in the workspace/email-templates/workspace/utilities directory.

If you were to change this to: <xsl:import href="../utilities/admin-email.xsl"/> it should work just fine. This tells Symphony to import the file from workspace/email-templates/../utilities/ which is the same as workspace/utilities which is exactly where your utility is located.

Hope that helps!

It seems like it would be the problems, but ...

changing it from ...

href="/utilities/admin-email.xsl"

to ...

href="../utilities/admin-email.xsl"

and it still yields:

Symphony Fatal Error: Error compiling xml with xslt: XSLTProcessor::importStylesheet(): I/O warning : failed to load external entity "/var/www/workspace/email-templates/utilities/admin-email.xsl"

Even with ...

href="/var/www/workspace/utilities/admin-email.xsl"

it yields ...

runtime error: file /var/www/workspace/utilities/admin-email.xsl line 20 element value-of

The file is indeed located at "/var/www/workspace/utilities/".

Take a look at the filesystem! Email templates have their own folder inside the email-templates folder, so you need to start the include path with ../../utilities/.

I get this whenever I try to preview HTML templates in the back end.

Attachments:
sym-email-problem.tiff

Can you file that issue on github please? Otherwise I'll forget about it :)

Parameters such as {$style} in the element <p style="{$style}"/> seem to cause the error. I've submitted it to Github.

How would I go about just sending an email via a form from the frontend that has no interaction with a Symphony Section?

I guess I'm going to have to customise an event to do this?

Scenario:

I have a page with a form, the form collects the data to send, and uses a datasource to get the name and email to send to. I have attached the same datasource to the email template. How do I filter this datasource to get the same single recipient? Are the same parameters available to filter the DS?

I'm really confused with this.

I'm a little confused by the difference of "no interaction with a Symphony Section" and your example where you're using a datasource (Section implied). At first I thought that you didn't want to store the information in a section, but you wanted to use it in an email. I think what I'm writing will fit your scenario.

Page with datasources including the one containing name and email sections. Page also includes event for email template manager with email. For example:

Page named Contact Update

  1. Datasource named Contacts by Member (Contacts section includes name and email field filtered however you want it. In this case, it is implied by member.)
  2. Event named Contact Update (includes Email Template Manager event named Send Email Template:Contacts Update...see below for creation) also could include other security events. Source isContacts.

Email Template named Send Email Template: Contacts Update is automatically created when entering a new template under Blueprints -> Email Templates -> Create New

  • Datasource named Contacts Email (Contacts section filtered by $etm-entry-id. The $etm-entry-id is the system-id from the Event Source. In this case it is the item 2 above Source Contacts.

    xsl:copy-of select="."

    is a good way to see the available data for the email body and setting up the recipients and subject line.

Event Filters complete the puzzle and are typically added to modify the actions of the events.

I hope this is accurate and that it helps. I've been working on emails to coincide with the members extension.

It looks like I'm going to have to customise the event to strip the section saving code out, as I just need to send an emil to details pulled out of a section (using a datasource).

The problem I have is how to pass along these details from the frontend datasource into the ETM to filter it's own datasource. None of these details are from a Members section, and the only examples I can see are from Members integrations.

This is where the confusion is coming from here.

The $etm-entry-id is the system-id from the Event Source

I understand this, but as my event technically has no source, as it's not updating anything, this is where it falls down.

Event Filters complete the puzzle and are typically added to modify the actions of the events.

Thanks, I understand the core concepts of Symphony better than most ;)

Ok, so I'm slogging my way through how to do this, and I'm making progress, but it's highlighting some glaring issues from a performance point of view for me.

To get the ID of the contact details through to the ETM, I'm having to call an entire entry object in the event just to pass this object, to get an ID to then call the entire entry object again in the datasource for creating the template.

Huib, I'll log an issue on the repo for this, as we could discuss ways to make this easier to get the details through to the ETM template generation.

@designermonkey, I don't really understand why you don't want to save the data. Can you explain?

BTW, there are two auto-populated params if you use an ETM event filter:

  • $etm-entry-id — can be used to filter the entry datasource
  • $etm-recipient — can be used to filter other datasources

If you don't create an entry, forget the first one. You will probably want to send static email content only.

The $etm-recipient should still be resolved/populated dynamically by the ETM.

If you can explain more precisely what you are trying to achieve, I might be able to give additional pointers.

If you can not use an event filter (for whatever reason), you will have to talk to the ETM and Core Email via the API. Here is an old snippet I found — I can't guarantee that it still works, but it's shows the basic approach:

require_once(EXTENSIONS . '/email_template_manager/lib/class.emailtemplatemanager.php');

$email = Email::create();

$template = EmailTemplateManager::load('foo-template');
$template->addParams(array("etm-entry-id" => $entry_id));
$xml = $template->processDatasources();
$template->setXML($xml->generate());
$template->recipients = $emailaddr;
$template->parseProperties();
$properties = $template->getParsedProperties();
$content = $template->render();

if(!empty($content['subject'])){
    $email->subject = $content['subject'];
}

if(isset($content['reply-to-name'])){
    $email->reply_to_name = $content['reply-to-name'];
}

if(isset($content['reply-to-email-address'])){
    $email->reply_to_email_address = $content['reply-to-email-address'];
}

if(isset($content['plain']))
    $email->text_plain = $content['plain'];

if(isset($content['html']))
    $email->text_html = $content['html'];

// Optional: overwrite default sender
$email->sender_name            = 'Foo Bar';
$email->sender_email_address   = 'foo.bar@example.com';

$email->recipients = array($emailaddr);

$email->send();

P.S.: You will find more in the ETM's extension driver _sendEmail() function.

Thanks for your response Michael, I'll explain in more detail later, just got it working a little hacky way, but I understand your example.

Just got some urgent work to complete.

John, please file a bug if you want me to remember this :-)

I started writing it earlier, then got into something else, then closed the tab o_O

Will do it again.

This extension is excellent, however I have run into an issue I am not sure how to solve. We use this on a couple of simple sites, where there is a contact form and two emails are sent out when this is completed.

One to the website administrator informing them that an enquiry has been made and the other to the user who completed the form. These both work great. However when the administrator of the website replies to the email they have received, it is automatically picking up the 'from' address, which is set in preferences. Rather than the 'reply-to' address, which does seem to be set up correctly.

Because in most cases the default from address in preferences is usually the same as the administrator address my client ends up sending the email to themselves as opposed to the user who completed the form. Is there a way I can alter the 'from' address to read the same as the 'reply-to' address to prevent this from happening?

Many thanks

I don't know any email client which disregards the Reply-to header and uses From instead. Can you tell me which email program does this?

(The From name and address can not be changed in the ETM. I have a hacked version of the extension which has this feature, however. But this only works for Symphony 2.2.x at the moment.)

Hi,

i have installed this extension along members on a symphony 2.3.1 intall. i have a simple register form which works fine (creates deactivated member entry). i then created an email template with the recipient email set to the entered email adress (pulled from member-section datasource filtered by $etm-entry-id). the email template provides the activation code. i attached the corresponding event filter for this template to my create member event. so far so good :)

when i now register using the form the entry gets created as expected and in my event output i see the etm-filter as having passed and sent <filter name="etm-member-activate-account" status="passed" total="1" sent="1" />

alas, no email is being sent out :(

can anyone explain to me what i did wrong?

ps. i have chosen sendmail from the preferences and provided a sender name and mail adress (fake one, info@example.com)

thanks for any insights!

If you've chosen sendmail, then it's more than likely an issue with how your mail is set up on the server you're installed on.

I have tried this too, and couldn't get it to work, so I switched for an authenticated SMTP service, and all works fine now.

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