Jump to content

Envoi d'email automatique depuis les onglets prestashop

Recommended Posts



Je ne parviens pas à rajouter un envoi de mail automatique depuis l'onglet CLIENT du back office prestashop v1.3


J'ai réussi à rajouter un textearea pour intégrer des notes mais j'aimerai que le client le reçoive par mail or le mail ne part pas...


Voici mon code de la page ajax.php

if (Tools::isSubmit('submitCustomerNote2') AND $id_customer = (int)Tools::getValue('id_customer'))

	$note = html_entity_decode(Tools::getValue('note2'));
	$varsTpl2 = array('{lastname}' => 'test', '{firstname}' => 'test', '{id_order}' => '5', '{message}' => 'test');
	if (!empty($note) AND !Validate::isCleanHtml($note))
		die ('error:validation');
	if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET `note` = "'.pSQL($note, true).'" WHERE id_customer = '.(int)$id_customer.' LIMIT 1'))
		die ('error:update');
			if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'message_client (message, id_customer, id_employee, private, date_add) values ("'.pSQL($note, true).'", "'.(int)$id_customer.'","'.(int)$id_employee.'", "0", NOW()) '))
		if (@Mail::Send(intval($cookie->id_lang), 'order_merchant_comment', 'test', $varsTpl2, 'vboullier@gmail.com', 'test'))
		die ('error:insert');


Tout fonctionne sauf l'envoi du mail???


Je ne comprend pas


Merci de votre aide


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

  • Create New...

Important Information

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