FLUX RSS



ACCUEIL / FORUMS / QUESTIONS TECHNIQUES / PROBLEME DE MAIL / FORMULAIRE DE CONTACT




sondages
Avez-vous déjà utilisé les exports statiques ? :
oui
non
RESULTATS | SONDAGES
liens
eZ systems
http://ez.no
PHPEdit
http://www.waterproof.fr/
AFUL
http://www.aful.org
Framasoft
http://www.framasoft.net
Probleme de mail / formulaire de contact

Vous devez être connecté pour utiliser le forum. Vous pouvez le faire ici.

Auteur Message

guillaume jupin

Jeudi 05 Février 2009 3:33:34 pm

Probleme de mail / formulaire de contact

bonjour,

J'ai ajouté un formulaire de contact (mon premier) et le souci, c'est que je recupere les infos dans le collecteur d'information mais que mon mail ne part pas...

Voici le code de ma mon template qui affiche mon formulaire de contact (/design/monsite_base/override/templates/full/feedback_form.tpl) :

{* Feedback form - Full view *}

<div class="border-box">
<div class="border-tl"><div class="border-tr"><div class="border-tc"></div></div></div>
<div class="border-ml"><div class="border-mr"><div class="border-mc float-break">

<div class="content-view-full">
<div class="class-feedback-form">

<div class="attribute-header">
<h1>{$node.name|wash()}</h1>
</div>

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

<div class="attribute-short">
{attribute_view_gui attribute=$node.data_map.description}
</div>
<form method="post" action={"content/action"|ezurl}>

<h4>{$node.data_map.sender_name.contentclass_attribute.name}</h4>
<div class="attribute-sender-name">
{attribute_view_gui attribute=$node.data_map.sender_name}
</div>

<h4>{$node.data_map.email.contentclass_attribute.name}</h4>
<div class="attribute-email">
{attribute_view_gui attribute=$node.data_map.email}
</div>

<h4>{$node.data_map.subject.contentclass_attribute.name}</h4>
<div class="attribute-subject">
{attribute_view_gui attribute=$node.data_map.subject}
</div>

<h4>{$node.data_map.message.contentclass_attribute.name}</h4>
<div class="attribute-message">
{attribute_view_gui attribute=$node.data_map.message}
</div>

<div class="content-action">
<input type="submit" class="defaultbutton" name="ActionCollectInformation" value="{"Send form"|i18n("design/ezwebin/full/feedback_form"}" />
<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>

</div>
</div>

</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>

voici le code de la page qui collect les information (/design/monsite_base/template/content/collectedinfo/form.tpl):

{def $collection = cond( $collection_id, fetch( content, collected_info_collection, hash( collection_id, $collection_id ) ),
fetch( content, collected_info_collection, hash( contentobject_id, $node.contentobject_id ) ) )}

{set-block scope=global variable=title}{'Form %formname'|i18n( 'design/ezwebin/collectedinfo/form', , hash( '%formname', $node.name|wash() ) )}{/set-block}

<div class="border-box">
<div class="border-tl"><div class="border-tr"><div class="border-tc"></div></div></div>
<div class="border-ml"><div class="border-mr"><div class="border-mc">

<div class="attribute-header">
<h1>{$object.name|wash}</h1>
</div>

<p>{'Thank you for your feedback.'|i18n( 'design/ezwebin/collectedinfo/form' )}</p>

{if $error}

{if $error_existing_data}
<p>{'You have already submitted this form. The data you entered was:'|i18n('design/ezwebin/collectedinfo/form')}</p>
{/if}

{/if}

{foreach $collection.attributes as $attribute}

<p>{$attribute.contentclass_attribute_name|wash}: {attribute_result_gui view=info attribute=$attribute} </p>

{/foreach}

<p/>

<a href={$node.parent.url|ezurl}>{'Return to site'|i18n('design/ezwebin/collectedinfo/form')}</a>

</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>

voici le code de la page qui est censé envoyé le mail et qui ne le fait pas : (/design/monsite_base/template/content/collectedinfomail/feedback.tpl):

{set-block scope=root variable=subject}{"Feedback from %1"|i18n("design/ezwebin/collectedinfomail/feedback",,array($collection.object.name|wash))}{/set-block}

{if and( is_set( $object.data_map.recipient ), $object.data_map.recipient.has_content )}
{set-block scope=root variable=email_receiver}{$object.data_map.recipient.content}{/set-block}
{/if}


{* Set this to redirect to another node
{set-block scope=root variable=redirect_to_node_id}2{/set-block}
*}

{"The following feedback was collected"|i18n("design/ezwebin/collectedinfomail/feedback"}:

{foreach $collection.attributes as $attribute}
{$attribute.contentclass_attribute_name|wash()}:
{attribute_result_gui view=info attribute=$attribute}

{/foreach}



Et enfin voici le code de mon fichier collect.ini.append.php

#?ini charset="iso-8859-1"?
# eZ Publish configuration file.
#
# NOTE: It is not recommended to edit this files directly, instead
# a file in override should be created for setting the
# values that is required for your site. Either create
# a file called settings/override/collect.ini.append or
# settings/override/collect.ini.append.php for more security
# in non-virtualhost modes (the .php file may already be present
# and can be used for this purpose).

[InfoSettings]
# The default information collection type
Type=form
# Matches class id or identifier to information collection type
TypeList[]
TypeList[poll]=poll
TypeList[form]=form
TypeList[contact]=contact
TypeList[question]=question
TypeList[feedback]=feedback
# Which attribute to look for in the object to determine type
# if found the content of the attribute will be used for type
TypeAttribute=collection_type

[EmailSettings]
SendEmail=enabled
# Matches class id or identifier to information collection type
#SendEmailList[poll]=disabled
SendEmailList[feedback]=enabled
# Which attribute to look for in the object to determine
# if an email should be sent.
# If found the setting will override all other settings.
SendEmailAttribute=collection_email

[DisplaySettings]
# result - Display IC result, for instance poll result or your form data
# redirect - Redirect to a specific url
# node - Redirect back to content node
Display=result
# Matches class id or identifier to information collection type
DisplayList[]
#DisplayList[poll]=result
DisplayList[contact]=result
DisplayAttribute=collection_display
# The url to redirect to if DisplayHandling is set to redirect
RedirectURL=/
# Matches class id or identifier to information collection type
RedirectURLList[]
RedirectURLAttribute=collection_redirect

[CollectionSettings]
# if enabled then information from anonymous users can be collected
CollectAnonymousData=enabled
# Same as CollectAnonymousData but is a list with of IC types and
# their override settings, if specified it will override default setting
CollectAnonymousDataList[]
CollectAnonymousDataList[contact]=enabled
CollectAnonymousDataList[poll]=enabled
CollectAnonymousDataAttribute=collection_anonymous
# How information collection is handled in terms of user identification
#
# multiple - each user can submit multiple data
# unique - one set of data per user, if already exists give a warning
# overwrite - one set of data per user but new entry overwrites old one
CollectionUserData=multiple
# Matches class id or identifier to information collection type
CollectionUserDataList[]
#CollectionUserDataList[feedback]=multiple
CollectionUserDataList[contact]=multiple
CollectionUserDataList[poll]=unique
CollectionUserDataAttribute=collection_userdata


Ma configuration de mail dans mon site.ini est bonne et j'ai bien mis les droits sur le dossier collectedinfomail

Voila si quelqu'un pouvais m'aider ça serait super !

Merci a vous

Guillaumej02

guillaume jupin

Lundi 16 Février 2009 2:45:01 pm

Re: Probleme de mail / formulaire de contact

Bon j'ai trouvé la solution depuis le temps !

En fait le code au dessus est bon et il fonctionne parfaitement....


Mais comme j'utilise une version 4.0.1 de ezpubulish il y a un bug de developpement, j'ai donc du remplacer un fichier php (smtp.php si je me souviens bien) et ça fonctionnne !

Guillaumej02

actualités
Traduction d'un tutorial eZ
eZ publish 4.0 est sorti
EzPublish 3.9 enfin disponible !
Ez Publish 3.9 RC2 est en ligne !
Ez Publish 3.9 RC1 disponible !
références
Site ohmycom
OhmyBlog