Jump to content

Mail quand quelqu'un s'inscrit [Résolu]


Recommended Posts

Bonjour,

J'ai des personnes qui s'inscrivent sans forcément commander, du coup je ne vois même pas que j'ai des inscrits en plus.

Il y a un moyen d'être prévenu par mail...même un mail avec juste "1 nouvel inscrit sur objetsbois.com" suffirait.

J'ai le module Alertes email v2.2 par PrestaShop d'activé mais je n'ai que recevoir un mail quand il y a :

-Nouvelle commande

-Hors stock

Je suis sous prestashop 1.4.0.17

Merci d'avance, en espérant avoir cette petite option rapidement :-)

Link to comment
Share on other sites

  • 2 months later...

Bon, j'ai tout tenté je n'y arrive pas...si quelqu'un à une piste je suis preneur :rolleyes:

 

Je suis obligé de regarder les stats tout le temps en me souvenant du nombre d'inscrits...pour voir s'il a ou non augmenté et comme je ne regarde pas tous les jours, je ne les vois pas.

Link to comment
Share on other sites

  • 3 months later...

C'est bon, j'ai rajouté quelques lignes dans le module MAILALERTS

Fichier mailalerts.php :

 

Dans :

if (!parent::install() OR

!$this->registerHook('newOrder') OR

!$this->registerHook('updateQuantity') OR

!$this->registerHook('productOutOfStock') OR

!$this->registerHook('customerAccount') OR

!$this->registerHook('updateProduct') OR

!$this->registerHook('deleteProduct') OR

!$this->registerHook('deleteProductAttribute') OR

!$this->registerHook('updateProductAttribute')

 

)

return false;

 

 

Rajouter : OR !$this->registerHook('createAccount')

ce qui donne :

if (!parent::install() OR

!$this->registerHook('newOrder') OR

!$this->registerHook('updateQuantity') OR

!$this->registerHook('productOutOfStock') OR

!$this->registerHook('customerAccount') OR

!$this->registerHook('updateProduct') OR

!$this->registerHook('deleteProduct') OR

!$this->registerHook('deleteProductAttribute') OR

!$this->registerHook('updateProductAttribute')

OR !$this->registerHook('createAccount')

)

return false;

 

puis rajouter la fonction :

public function hookCreateAccount($params) {

if (empty($this->_merchant_mails))

return;

 

$customer = $params['newCustomer'];

$id_lang = (int)(Configuration::get('PS_LANG_DEFAULT'));

$iso = Language::getIsoById((int)($id_lang));

$template = 'new_account';

$subject = $this->l('New account');

$templateVars = array(

'{firstname}' => $customer->firstname,

'{lastname}' => $customer->lastname,

'{email}' => $customer->email,

'{shop_name}' => Configuration::get('PS_SHOP_NAME'),

);

if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.html'))

Mail::Send($id_lang, $template, $subject, $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, $configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME'], NULL, NULL, dirname(__FILE__).'/mails/');

}

 

Dans le répertoire MAIL puis FR

créer 2 fihiers : new_account.txt et new_account.html

 

Dans new_account.html mettre :

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>[{shop_name}] Nouveau compte</title>

</head>

<body>

<table style="font-family:Verdana,sans-serif; font-size:11px; color:#374953; width: 550px;">

<tr>

<td>

<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>

</td>

</tr>

<tr><td> </td></tr>

<tr>

<td><span style="color: coral; font-weight: bold;">Un nouveau compte a été créé : {firstname} {lastname} ({email})</td>

</tr>

</table>

</body>

</html>

 

 

Dans new_account.txt mettre :

Bonjour,

 

Un nouveau compte a été créé : {firstname} {lastname} ({email}) sur {shop_name}.

 

Ensuite réinitialiser le module Mailalerts et le tour est joué...

Link to comment
Share on other sites

De rien :)

J'étais franchement heureux quand je l'ai trouvé (sur ce forum je crois bien d'ailleurs).

 

Maintenant j'aimerais bien trouver la même astuce quand quelqu'un poste un commentaire sur un produit...faut toujours aller zieuter dans le module commentaire (pas très pratique)

  • Like 1
Link to comment
Share on other sites

  • 3 years later...

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...