Browse Source

Merge branch 'develop'

master
Guillaume 4 years ago
parent
commit
a6c2d2242f
5 changed files with 20 additions and 6 deletions
  1. +2
    -1
      ShopBundle/Form/Backend/User/TicketTypesNotificationType.php
  2. +1
    -0
      ShopBundle/Form/Frontend/TicketType.php
  3. +2
    -0
      ShopBundle/Model/Ticket.php
  4. +1
    -0
      ShopBundle/Resources/translations/lcshop.fr.yaml
  5. +14
    -5
      ShopBundle/Services/MailUtils.php

+ 2
- 1
ShopBundle/Form/Backend/User/TicketTypesNotificationType.php View File

@@ -35,7 +35,8 @@ class TicketTypesNotificationType extends AbstractType
'field.Ticket.typeOptions.'.Ticket::TYPE_GENERAL_QUESTION => Ticket::TYPE_GENERAL_QUESTION,
'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_ERROR=> Ticket::TYPE_PRODUCT_ERROR ,
'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_UNAVAILABLE => Ticket::TYPE_PRODUCT_UNAVAILABLE,
'field.Ticket.typeOptions.'.Ticket::TYPE_TECHNICAL_PROBLEM => Ticket::TYPE_TECHNICAL_PROBLEM
'field.Ticket.typeOptions.'.Ticket::TYPE_TECHNICAL_PROBLEM => Ticket::TYPE_TECHNICAL_PROBLEM,
'field.Ticket.typeOptions.'.Ticket::TYPE_POULTRY_BOOKING => Ticket::TYPE_POULTRY_BOOKING
),
'required' => false,
'expanded' => false,

+ 1
- 0
ShopBundle/Form/Frontend/TicketType.php View File

@@ -58,6 +58,7 @@ class TicketType extends AbstractType
'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_UNAVAILABLE => Ticket::TYPE_PRODUCT_UNAVAILABLE,
'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_ERROR => Ticket::TYPE_PRODUCT_ERROR,
'field.Ticket.typeOptions.'.Ticket::TYPE_TECHNICAL_PROBLEM => Ticket::TYPE_TECHNICAL_PROBLEM,
'field.Ticket.typeOptions.'.Ticket::TYPE_POULTRY_BOOKING => Ticket::TYPE_POULTRY_BOOKING,
],
'translation_domain' => 'lcshop',
]) ;

+ 2
- 0
ShopBundle/Model/Ticket.php View File

@@ -22,6 +22,8 @@ abstract class Ticket extends AbstractEntity implements FilterMerchantInterface
const TYPE_PRODUCT_ERROR = 'product-error' ;
const TYPE_TECHNICAL_PROBLEM = 'technical-problem' ;
const TYPE_GENERAL_QUESTION = 'general-question' ;
const TYPE_POULTRY_BOOKING = 'poultry-booking' ;


const TICKET_STATUS_OPEN = 'open' ;
const TICKET_STATUS_BEING_PROCESSED = 'being-processed' ;

+ 1
- 0
ShopBundle/Resources/translations/lcshop.fr.yaml View File

@@ -462,6 +462,7 @@ field:
product-unavailable: Produit manquant
product-error: Erreur sur un produit
technical-problem: Problème techique
poultry-booking: Réservation volaille
statusOptions:
open: Ouvert
being-processed: En cours de traitement

+ 14
- 5
ShopBundle/Services/MailUtils.php View File

@@ -24,6 +24,7 @@ class MailUtils
const ATTACHMENT_DATA = 'attachment-data';
const ATTACHMENT_FILENAME = 'attachment-filename';
const ATTACHMENT_CONTENT_TYPE = 'attachment-content-type';
//const DISPOSITION_NOTIFICATION_TO = 'disposition-notification-to' ;

protected $transport;
protected $templating;
@@ -75,20 +76,19 @@ class MailUtils
->setBody($this->templating->render($params[self::CONTENT_TEMPLATE] . '-html.html.twig', $contentData), 'text/html')
->addPart($this->templating->render($params[self::CONTENT_TEMPLATE] . '-text.html.twig', $contentData));

if (isset($params[self::COPY_TO]) && strlen($params[self::COPY_TO])) {
if(isset($params[self::COPY_TO]) && strlen($params[self::COPY_TO])) {
$message->addCc($params[self::COPY_TO]);
}

if (isset($params[self::COPY_HIDDEN_TO]) && strlen($params[self::COPY_HIDDEN_TO])) {
if(isset($params[self::COPY_HIDDEN_TO]) && strlen($params[self::COPY_HIDDEN_TO])) {
$message->addBcc($params[self::COPY_HIDDEN_TO]);
}


if (isset($params[self::REPLY_TO]) && strlen($params[self::REPLY_TO])) {
if(isset($params[self::REPLY_TO]) && strlen($params[self::REPLY_TO])) {
$message->addReplyTo($params[self::REPLY_TO]);
}

if (isset($params[self::ATTACHMENT_DATA]) && isset($params[self::ATTACHMENT_FILENAME]) && isset($params[self::ATTACHMENT_CONTENT_TYPE])) {
if(isset($params[self::ATTACHMENT_DATA]) && isset($params[self::ATTACHMENT_FILENAME]) && isset($params[self::ATTACHMENT_CONTENT_TYPE])) {
$message->attach(\Swift_Attachment::newInstance(
$params[self::ATTACHMENT_DATA],
$params[self::ATTACHMENT_FILENAME],
@@ -96,6 +96,15 @@ class MailUtils
));
}

/*if(isset($params[self::DISPOSITION_NOTIFICATION_TO]) && $params[self::DISPOSITION_NOTIFICATION_TO]) {
$emailFromDispositionNotificationTo = $emailFrom ;
if(isset($params[self::REPLY_TO]) && strlen($params[self::REPLY_TO])) {
$emailFromDispositionNotificationTo = $params[self::REPLY_TO] ;
}
$message->getHeaders()->addTextHeader('Disposition-Notification-To', $emailFromDispositionNotificationTo) ;
$message->getHeaders()->addMailboxHeader('Disposition-Notification-To', $emailFromDispositionNotificationTo);
}*/

$this->transport->send($message);
}
}

Loading…
Cancel
Save