Module DHL : modif pour rajout de données dans l'envoi du mail
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace DHL;
|
||||
|
||||
use DHL\Model\Config\DHLConfigValue;
|
||||
use DHL\Model\DHLDeliveryPrice;
|
||||
use DHL\Model\DHLDeliveryPriceQuery;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
@@ -184,12 +183,4 @@ class DHL extends AbstractDeliveryModule
|
||||
return $postage;
|
||||
}
|
||||
|
||||
// public function update($currentVersion, $newVersion, ConnectionInterface $con = null)
|
||||
// {
|
||||
// $uploadDir = __DIR__ . '/Config/prices.json';
|
||||
// if (is_readable($uploadDir) && DHL::getConfigValue(DHLConfigValue::PRICES, null) == null) {
|
||||
// DHL::setConfigValue(DHLConfigValue::PRICES, file_get_contents($uploadDir));
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace DHL\Listener;
|
||||
|
||||
use DHL\DHL;
|
||||
use DHL\Model\Config\DHLConfigValue;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Thelia\Core\Event\Order\OrderEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
@@ -21,20 +12,16 @@ use Thelia\Log\Tlog;
|
||||
use Thelia\Mailer\MailerFactory;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Model\MessageQuery;
|
||||
use Thelia\Model\OrderStatus;
|
||||
use Thelia\Module\PaymentModuleInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Class SendMail
|
||||
* @package DHL\Listener
|
||||
* @author Manuel Raynaud <manu@raynaud.io>
|
||||
* @author Laurent LE CORRE <laurent@thecoredev.fr>
|
||||
*/
|
||||
class SendMail implements EventSubscriberInterface
|
||||
{
|
||||
|
||||
protected $parser;
|
||||
|
||||
protected $mailer;
|
||||
|
||||
public function __construct(ParserInterface $parser, MailerFactory $mailer)
|
||||
@@ -69,7 +56,7 @@ class SendMail implements EventSubscriberInterface
|
||||
$this->parser->assign('order_date', $order->getCreatedAt());
|
||||
$this->parser->assign('update_date', $order->getUpdatedAt());
|
||||
$this->parser->assign('package', $order->getDeliveryRef());
|
||||
|
||||
$this->parser->assign('tracking_url', DHL::getConfigValue(DHLConfigValue::TRACKING_URL));
|
||||
|
||||
$message
|
||||
->setLocale($order->getLang()->getLocale());
|
||||
@@ -80,7 +67,6 @@ class SendMail implements EventSubscriberInterface
|
||||
;
|
||||
|
||||
// Build subject and body
|
||||
|
||||
$message->buildMessage($this->parser, $instance);
|
||||
|
||||
$this->mailer->send($instance);
|
||||
|
||||
Reference in New Issue
Block a user