Browse Source

Merge branch 'develop'

master
Guillaume 4 years ago
parent
commit
812c9bee98
2 changed files with 22 additions and 0 deletions
  1. +11
    -0
      ShopBundle/Services/MailUtils.php
  2. +11
    -0
      ShopBundle/Services/Utils.php

+ 11
- 0
ShopBundle/Services/MailUtils.php View File

@@ -13,6 +13,8 @@ class MailUtils
const SUBJECT = 'subject';
const SUBJECT_PREFIX = 'subject-prefix';
const TO_EMAIL = 'to-email';
const COPY_TO = 'copy-to';
const COPY_HIDDEN_TO = 'copy-hidden-to';
const TO_NAME = 'to-name';
const FROM_EMAIL = 'from-email';
const FROM_NAME = 'from-name';
@@ -73,6 +75,15 @@ 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])) {
$message->addCc($params[self::COPY_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])) {
$message->addReplyTo($params[self::REPLY_TO]);
}

+ 11
- 0
ShopBundle/Services/Utils.php View File

@@ -7,6 +7,8 @@ use Doctrine\ORM\EntityManagerInterface;
use EasyCorp\Bundle\EasyAdminBundle\Configuration\ConfigManager;
use Geocoder\Model\Coordinates;
use Geocoder\Provider\Addok\Addok;
use Geocoder\Provider\GoogleMaps\GoogleMaps;
use Geocoder\Provider\Nominatim\Nominatim;
use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;
use Lc\ShopBundle\Context\ImageInterface;
@@ -266,7 +268,16 @@ class Utils
public function getGeocoderProvider()
{
$symfonyClient = new HttplugClient();

/* API du gouvernement */
$provider = new Addok($symfonyClient, 'https://api-adresse.data.gouv.fr') ;

/* Google Maps */
//$provider = new GoogleMaps($symfonyClient, null, '') ;

/* Nominatim : OpenStreetMap */
//$provider = Nominatim::withOpenStreetMapServer($symfonyClient, 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion');

return $provider ;
}


Loading…
Cancel
Save