Jump to content

[RESOLU] Customisation du tpl mail automatique du contact-formulaire.php


daftfunk
 Share

Recommended Posts

Bonsoir!

 

Une petite question en ce début de WE

 

 

if (!empty($contact->email))
{
$id_order = (int)Tools::getValue('id_order', 0);
$order = new Order($id_order);

$mail_var_list = array(
'{email}' => $from,
'{message}' => Tools::nl2br(stripslashes($message)),
'{id_order}' => $id_order,
'{order_name}' => $order->getUniqReference(),
'{attached_file}' => isset($_FILES['fileUpload'], $_FILES['fileUpload']['name']) ? $_FILES['fileUpload']['name'] : ''
);

if (Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form'),
$mail_var_list, $contact->email, $contact->name, $from, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''),
$fileAttachment) &&
Mail::Send($this->context->language->id, 'contact_form', Mail::l('Your message has been correctly sent'), $mail_var_list, $from))
$this->context->smarty->assign('confirmation', 1);
else
$this->errors[] = Tools::displayError('An error occurred while sending message.');
}

 

Ce petit bout de code décrit la formation et l'envois du mail contact - Ce que je voudrais comprendre c'est ou on fait appelle au tpl contact.html pour envoyer les infos. mon but étant de générer ces infos avec un autre tpl naturellement

 

 

Merci de votre patience

 

B

Edited by daftfunk (see edit history)

Share this post


Link to post
Share on other sites

j'ai trouvé mais c'est tellement évident que j'en suis honteux

 

 

if (Mail::Send($this->context->language->id, 'XXXX', Mail::l('Message from contact form'),
$mail_var_list, $contact->email, $contact->name, $from, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''),
$fileAttachment) &&
Mail::Send($this->context->language->id, 'XXXX', Mail::l('Your message has been correctly sent'), $mail_var_list, $from))
$this->context->smarty->assign('confirmation', 1);

 

 

les XXXX c'est le nom du tpl mais il faut veiller a mettre les .html et .txt

 

Voila

Edited by daftfunk (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More