Jump to content

Email de commande modifiée [Résolu]


Recommended Posts

Citation

Tiri a dit :

Bonjour Eolia, ou puis je trouver mailalert pour modifier le code ? 

Je suis sous presta 1.7 et tente de trouver par ftp mais rien du tout 😉 🙂 

Merci si tu as le chemin...

Tres bonne journée

Aucune idée, je refuse de travailler sur les 1.7

Link to comment
Share on other sites

8 hours ago, Eolia said:

Oui, il faut rajouter l'email désiré dans le code de mailalerts, fonction hookActionOrderEdited($params), 14ème paramètre de la fonction Mail::Send()

Thanks! I found it in the route modules / ps_emailalerts / ps_emailalerts.php

How should I properly modify it to add the store email in copy?

    public function hookActionOrderEdited($params)
    {
        if (!$this->order_edited || empty($this->order_edited)) {
            return;
        }

        $order = $params['order'];

        $data = array(
            '{lastname}' => $order->getCustomer()->lastname,
            '{firstname}' => $order->getCustomer()->firstname,
            '{id_order}' => (int) $order->id,
            '{order_name}' => $order->getUniqReference(),
        );

        Mail::Send(
            (int) $order->id_lang,
            'order_changed',
            Mail::l('Your order has been changed', (int) $order->id_lang),
            $data,
            $order->getCustomer()->email,
            $order->getCustomer()->firstname.' '.$order->getCustomer()->lastname,
            null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop);
    }

Thanks!

Link to comment
Share on other sites

After (int) $order->id_shop add a comma and your email

        Mail::Send(
            (int) $order->id_lang,
            'order_changed',
            Mail::l('Your order has been changed', (int) $order->id_lang),
            $data,
            $order->getCustomer()->email,
            $order->getCustomer()->firstname.' '.$order->getCustomer()->lastname,
            null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop, '[email protected]');

 

  • Like 1
Link to comment
Share on other sites

  • Eutanasio changed the title to Email de commande modifiée [Résolu]

Le code de Prestashop n'offre pas la possibilité de mettre plusieurs destinataires en copie cachée. (il faudrait modifier Swift RecipientList.php)

Si vous en voulez plusieurs il faut les mettre dans un tableau, avec celui du client à la place de $order->getCustomer()->email

array($order->getCustomer()->email, 'mail1, 'mail2', etc)

Mais le client verra les autres destinataires.

Autrement vous renvoyez vers une boite mail générique chez votre hébergeur qui, elle, est configurée pour faire suivre à plusieurs destinataires.

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