Jump to content

pas de message email quand un client s'inscrit


Recommended Posts

Bomjour, il ne me semble pas que cela soit prevu a la base, vous pouvez toujours overrider la function sendConfirmationMail du controller Authcontroller en remplacant:

protected function sendConfirmationMail(Customer $customer)
	{
		if (!Configuration::get('PS_CUSTOMER_CREATION_EMAIL'))
			return true;

		return Mail::Send(
			$this->context->language->id,
			'account',
			Mail::l('Welcome!'),
			array(
				'{firstname}' => $customer->firstname,
				'{lastname}' => $customer->lastname,
				'{email}' => $customer->email,
				'{passwd}' => Tools::getValue('passwd')),
			$customer->email,
			$customer->firstname.' '.$customer->lastname
		);
	}

par

protected function sendConfirmationMail(Customer $customer)
	{
		if (!Configuration::get('PS_CUSTOMER_CREATION_EMAIL'))
			return true;
                Mail::Send(
            $this->context->language->id,
            'account',
            Mail::l('Nouveau client inscrit!'),
            array(
                '{firstname}' => $customer->firstname,
                '{lastname}' => $customer->lastname,
                '{email}' => $customer->email,
                '{passwd}' => Tools::getValue('passwd')),
            'votre_email@votre_email.com'
        );
		return Mail::Send(
			$this->context->language->id,
			'account',
			Mail::l('Welcome!'),
			array(
				'{firstname}' => $customer->firstname,
				'{lastname}' => $customer->lastname,
				'{email}' => $customer->email,
				'{passwd}' => Tools::getValue('passwd')),
			$customer->email,
			$customer->firstname.' '.$customer->lastname
		);
	}
  • Like 1
Link to comment
Share on other sites

En fait pour faire proprement, il faudrait overrider le fichier, c'est a dire créer un ficher AuthController.php à mettre dans override/controllers/front   (si prestashop version >= 1.5)

 

et dans ce fichier:

class AuthController extends AuthControllerCore
{

   protected function sendConfirmationMail(Customer $customer)
    {
        if (!Configuration::get('PS_CUSTOMER_CREATION_EMAIL'))
            return true;
Mail::Send(
            $this->context->language->id,
            'account',
            Mail::l('Nouveau client inscrit!'),
            array(
                '{firstname}' => $customer->firstname,
                '{lastname}' => $customer->lastname,
                '{email}' => $customer->email,
                '{passwd}' => Tools::getValue('passwd')),
            'votre_email@votre_email.com'
        );
        return Mail::Send(
            $this->context->language->id,
            'account',
            Mail::l('Welcome!'),
            array(
                '{firstname}' => $customer->firstname,
                '{lastname}' => $customer->lastname,
                '{email}' => $customer->email,
                '{passwd}' => Tools::getValue('passwd')),
            $customer->email,
            $customer->firstname.' '.$customer->lastname
        );
    }


}

et ensuite effacer le fichier cache/class_index.php pour qu'il se régenere

Link to comment
Share on other sites

  • 2 weeks later...

Le solution de fred-vinapresta fonctionne parfaitement !

 

Mais si je puis me permettre coté discrétion, c'est pas top, ca envoie au marchant le code secret du client :huh:

 

Faudrait remplacer

'{passwd}' => Tools::getValue('passwd')),

 

par

'{passwd}' => '*********',

 

Voilà :rolleyes:

Link to comment
Share on other sites

  • 3 weeks 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...