Jump to content

Edit History

Saldyus

Saldyus

Fortunatamente sono riuscito a risolvere modificando il file PaymentModule.php /classes
Inizialmente avevo provato a modificare il file html con uno script, il quale in locale funzionava, ma quando veniva usato per mandare l'email invece non veniva eseguito, poi leggendo in un altro topic ho modificato il file indicato sopra modificandolo per il mio problema e ho creato un nuovo file .html e .txt. Se a qualcuno interessa lascio il codice modificato, dove order_conf_2 sono i template delle email.

if (Validate::isEmail($this->context->customer->email)) {
                            if (Tools::substr($order->payment, 0, 255) . ($order->hasBeenPaid() ? '' : ' ' . $this->trans('(waiting for validation)', [], 'Emails.Body')) == 'Ritiro in negozio' || Tools::substr($order->payment, 0, 255) . ($order->hasBeenPaid() ? '' : ' ' . $this->trans('(waiting for validation)', [], 'Emails.Body')) == 'Pagamento in contrassegno'){
                                Mail::Send(
                                    (int) $order->id_lang,
                                    'order_conf_2',
                                    Context::getContext()->getTranslator()->trans(
                                        'Order confirmation',
                                        [],
                                        'Emails.Subject',
                                        $orderLanguage->locale
                                    ),
                                    $data,
                                    $this->context->customer->email,
                                    $this->context->customer->firstname . ' ' . $this->context->customer->lastname,
                                    null,
                                    null,
                                    $file_attachement,
                                    null,
                                    _PS_MAIL_DIR_,
                                    false,
                                    (int) $order->id_shop
                                );
                            }else {
                                Mail::Send(
                                    (int) $order->id_lang,
                                    'order_conf',
                                    Context::getContext()->getTranslator()->trans(
                                        'Order confirmation',
                                        [],
                                        'Emails.Subject',
                                        $orderLanguage->locale
                                    ),
                                    $data,
                                    $this->context->customer->email,
                                    $this->context->customer->firstname . ' ' . $this->context->customer->lastname,
                                    null,
                                    null,
                                    $file_attachement,
                                    null,
                                    _PS_MAIL_DIR_,
                                    false,
                                    (int) $order->id_shop
                                );
                            }
                        }

Saldyus

Saldyus

Fortunatamente sono riuscito a risolvere modificando il file PaymentModule.php /classes
Inizialmente avevo provato a modificare il file html con uno script, il quale in locale funzionava, ma quando veniva usato per mandare l'email invece non veniva eseguito, poi leggendo in un altro topic ho modificato il file indicato sopra modificandolo per il mio problema e ho creato un nuovo file .html e .txt. Se a qualcuno interessa lascio il codice modificato, dove order_conf_2 sono i template delle email.

if (Validate::isEmail($this->context->customer->email)) {
                            if (Tools::substr($order->payment, 0, 255) . ($order->hasBeenPaid() ? '' : ' ' . $this->trans('(waiting for validation)', [], 'Emails.Body')) == 'Ritiro in negozio' || Tools::substr($order->payment, 0, 255) . ($order->hasBeenPaid() ? '' : ' ' . $this->trans('(waiting for validation)', [], 'Emails.Body')) == 'Pagamento in contrassegno'){
                                Mail::Send(
                                    (int) $order->id_lang,
                                    'order_conf_2',
                                    Context::getContext()->getTranslator()->trans(
                                        'Order confirmation',
                                        [],
                                        'Emails.Subject',
                                        $orderLanguage->locale
                                    ),
                                    $data,
                                    $this->context->customer->email,
                                    $this->context->customer->firstname . ' ' . $this->context->customer->lastname,
                                    null,
                                    null,
                                    $file_attachement,
                                    null,
                                    _PS_MAIL_DIR_,
                                    false,
                                    (int) $order->id_shop
                                );
                            }else {
                                Mail::Send(
                                    (int) $order->id_lang,
                                    'order_conf',
                                    Context::getContext()->getTranslator()->trans(
                                        'Order confirmation',
                                        [],
                                        'Emails.Subject',
                                        $orderLanguage->locale
                                    ),
                                    $data,
                                    $this->context->customer->email,
                                    $this->context->customer->firstname . ' ' . $this->context->customer->lastname,
                                    null,
                                    null,
                                    $file_attachement,
                                    null,
                                    _PS_MAIL_DIR_,
                                    false,
                                    (int) $order->id_shop
                                );
                            }
                        }

×
×
  • Create New...