Jump to content

Email client quand enregistremet via back office


zoé

Recommended Posts

bonjour,

 

je sais que c'est mal de toucher au CORE de Presta, mais je n'ai pas trouvé d'autre solution pour pouvoir envoyer un email de bienvenue à un client dont je crée moi même le compte en back office (en l'occurence pour le besoin de valider un accès PRO)

J'ai détérée l'info dans le forum...

 

Ca se passe dans le fichier AdminCustomers.php du répertoire TABS de votre admin

au niveau de la ligne 166, il faut repérer les lignes

 

// Default behavior (save and back)

Tools::redirectAdmin($currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$this->token);

 

et ajouter entre ces 2 lignes

 

if (!Mail::Send((int)(2), 'account', Mail::l('Welcome!'),

array('{firstname}' => Tools::getValue('firstname'), '{lastname}' => Tools::getValue('lastname'), '{email}' => Tools::getValue('email'), '{passwd}' => Tools::getValue('passwd')), Tools::getValue('email'), Tools::getValue('firstname').' '.Tools::getValue('lastname')))

 

$this->errors[] = Tools::displayError('Cannot send email');

 

Désolée pour ce hack, mais efficace.

 

Zoé

Link to comment
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...