Browse Source

[Mail] Correctif merchant

packProduct
Guillaume 2 years ago
parent
commit
5509456077
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      Notification/MailMailjetNotification.php

+ 6
- 4
Notification/MailMailjetNotification.php View File

@@ -15,6 +15,8 @@ class MailMailjetNotification extends SovMailMailjetNotification
{
protected MerchantResolver $merchantResolver;

const MERCHANT = 'merchant';

public function __construct(
MailjetTransport $mailjetTransport,
Environment $templating,
@@ -29,10 +31,10 @@ class MailMailjetNotification extends SovMailMailjetNotification

public function send($params = [])
{
$merchantCurrent = $this->merchantResolver->getCurrent();
$merchant = isset($params[self::MERCHANT]) ? $params[self::MERCHANT] : $this->merchantResolver->getCurrent();

$merchantConfigEmailFrom = $this->settingSolver->getSettingValue(
$merchantCurrent,
$merchant,
MerchantSettingDefinition::SETTING_EMAIL_FROM
);
$emailFrom = (isset($params[self::FROM_EMAIL]) && $params[self::FROM_EMAIL] && strlen(
@@ -40,13 +42,13 @@ class MailMailjetNotification extends SovMailMailjetNotification
)) ? $params[self::FROM_EMAIL] : $merchantConfigEmailFrom;

$merchantConfigEmailFromName = $this->settingSolver->getSettingValue(
$merchantCurrent,
$merchant,
MerchantSettingDefinition::SETTING_EMAIL_FROM_NAME
);
$emailFromName = isset($params[self::FROM_NAME]) ? $params[self::FROM_NAME] : $merchantConfigEmailFromName;

$merchantConfigEmailSubjectPrefix = $this->settingSolver->getSettingValue(
$merchantCurrent,
$merchant,
MerchantSettingDefinition::SETTING_EMAIL_SUBJECT_PREFIX
);
$emailSubjectPrefix = isset($params[self::SUBJECT_PREFIX]) ? $params[self::SUBJECT_PREFIX] : $merchantConfigEmailSubjectPrefix;

Loading…
Cancel
Save