This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » Setup & design » Send different mails from one...

Send different mails from one collectedinfomail template

Send different mails from one collectedinfomail template

Thursday 28 February 2013 10:24:22 pm - 3 replies

Hi everyone,
I have a form on my site and i'm sending some emails (receiver, cc, bcc) containing the collected information of that form. I'm using a collectedinfomail template.
For certain mails (bcc, for instance) i don't want to include all the information. I want to omit some attributes from the collection attributes. How do I achieve that? Any ideas?

Thanks in advance!


Friday 01 March 2013 8:47:05 am

You can use this extension for sending emails to regular, cc and bcc receivers. You can add condition in your template - if some email than it should be for ex. cc receiver than in a foreach loop put the exact information he needs to receive on email.

{def $message_for_user = "Initial text..."}
{foreach $collection.attributes as $item}
     {if or($item.contentclass_attribute_name|eq('Name of the class  attribute'), $item.contentclass_attribute_name|eq('Name of the class  attribute'))}
    {set $message_for_user = concat($message_for_user, $item.contentclass_attribute_name, ': ', $item.content, '<br/>')}
{send_tpl_mail  sender='' bcc_receivers=''  subject='Collect information from form...' body=$message_for_user}

Monday 04 March 2013 10:27:40 am


Thanks Milos, that is exactly what I was looking for...

Just one question... is it possible to define two collectedinfomail templates for the same form? ... If yes, is this another way to solve the problem? ...

Thanks again,


Monday 04 March 2013 12:08:45 pm

You should have all the logic in one template.
There you can define which user will receive all or just some parts of the collected informations.
You can put an array of receivers which will receive all the informations from that form, and you could put that cc receivers (also array, take a look at doc/readme.txt) receive just some parts of it.
I think that you should not include the second template for the same job.
You're welcome.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from