How can i specify email receiver for different form?

Author Message

Leeloo Dalas

Thursday 26 May 2005 3:46:10 am

Hello!

I have some form wich is used in differents parts of the site with different email receiver in each part.

In the file 'settings/siteaccess/my_site/site.ini.append.php' i did specify who is going to be the e-mail reciver.

[InformationCollectionSettings]
EmailReceiver=my_email@my_domain.com

How can i specify different email receiver for each form?

(For example:
data from partners registration form should be send on partners@my_domain.com,

data from PR registration form should be send on PR@my_domain.com)

Łukasz Serwatka

Thursday 26 May 2005 5:18:26 am

Hi,

To your feedback class add new attribute Recipient (Identifier: recipient) [Email datatype] which isn`t information collector. Now for every object (Feedback form) you can set Recipient e-mail.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Leeloo Dalas

Friday 27 May 2005 1:47:53 am

Ok.Thanks for your answer.
One more detail.
I did add this attribute, but where should i set Recipient e-mail: in template, ini files, some where in kernel code, lib? (seems like this attribute doesn't have default value).

luis muñoz

Wednesday 29 June 2005 7:49:27 am

I added the attribute to the class, added to my siteaccess design override/templates/content/collectinfomail/ form.tpl and feedback_form.tpl but it still sends the email to the address specified in the ini file.
Do i have to add any hidden field to the template?
Any idea?
This is the code i'm using to generate the code:

Thanks

{include name=Validation uri='design:content/collectedinfo_validation.tpl'
                 class='message-warning'
                 validation=$validation collection_attributes=$collection_attributes}

<form method="post" action={"content/action"|ezurl}>
{section var=Attributes loop=$node.object.contentobject_attributes}
    {section show=$Attributes.item.display_info.view.grouped_input}
    <fieldset>
        <legend>{$Attributes.item.contentclass_attribute.name|wash}</legend>
        {attribute_view_gui attribute=$Attributes.item}
    </fieldset>
    {section-else}
        <label>{$Attributes.item.contentclass_attribute.name|wash}:</label>
        {attribute_view_gui attribute=$Attributes.item}
    {/section}
	<br><br><br>
{/section}

<div class="content-action">
            <input type="submit" class="defaultbutton" name="ActionCollectInformation" 
                   value="{"Send form"|i18n("design/base")}" />
            <input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
            <input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
            <input type="hidden" name="ViewMode" value="full" />
        </div>
</form>

Leeloo Dalas

Friday 01 July 2005 2:04:10 am

Here you can find usefull information i think.
http://ez.no/ez_publish/documentation/customization/components/information_collection

Then look into part 6 in this page- "<b>Create the override template to send the emails</b>"

In this template look here:

{* Use this line to specify the e-mail in the template, can read this from the object to make it dynamic pr form *} 

{set-block scope=root variable=email_receiver}{$object.data_map.reciver.content}{/set-block}

So, {$object.data_map.<b>reciver</b>.content} will be your recipient. <b>reciver</b>-name of attribute that you have to add into the class,

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.