Skip to content

Resolve New Order not sending if a comma is followed by a blank space in the 'Send Order Email Copy To' field issue25072 #25085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Resolve New Order not sending if a comma is followed by a blank space…
… in the 'Send Order Email Copy To' field issue25072
  • Loading branch information
edenduong committed Oct 16, 2019
commit e075022c8268ca1dfdd9b327bcb6142e01254854
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Sales\Model\Order\Email\Container;

/**
* Class \Magento\Sales\Model\Order\Email\Container\CreditmemoCommentIdentity
*/
class CreditmemoCommentIdentity extends Container implements IdentityInterface
{
/**
* Configuration paths
*/
const XML_PATH_EMAIL_COPY_METHOD = 'sales_email/creditmemo_comment/copy_method';
const XML_PATH_EMAIL_COPY_TO = 'sales_email/creditmemo_comment/copy_to';
const XML_PATH_EMAIL_IDENTITY = 'sales_email/creditmemo_comment/identity';
Expand All @@ -15,6 +23,8 @@ class CreditmemoCommentIdentity extends Container implements IdentityInterface
const XML_PATH_EMAIL_ENABLED = 'sales_email/creditmemo_comment/enabled';

/**
* Is email enabled
*
* @return bool
*/
public function isEnabled()
Expand All @@ -27,18 +37,22 @@ public function isEnabled()
}

/**
* Return email copy_to list
*
* @return array|bool
*/
public function getEmailCopyTo()
{
$data = $this->getConfigValue(self::XML_PATH_EMAIL_COPY_TO, $this->getStore()->getStoreId());
if (!empty($data)) {
return explode(',', $data);
return array_map('trim', explode(',', $data));
}
return false;
}

/**
* Return email copy method
*
* @return mixed
*/
public function getCopyMethod()
Expand All @@ -47,6 +61,8 @@ public function getCopyMethod()
}

/**
* Return guest template id
*
* @return mixed
*/
public function getGuestTemplateId()
Expand All @@ -55,6 +71,8 @@ public function getGuestTemplateId()
}

/**
* Return template id
*
* @return mixed
*/
public function getTemplateId()
Expand All @@ -63,6 +81,8 @@ public function getTemplateId()
}

/**
* Return email identity
*
* @return mixed
*/
public function getEmailIdentity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Sales\Model\Order\Email\Container;

/**
* Class \Magento\Sales\Model\Order\Email\Container\CreditmemoIdentity
*/
class CreditmemoIdentity extends Container implements IdentityInterface
{
/**
* Configuration paths
*/
const XML_PATH_EMAIL_COPY_METHOD = 'sales_email/creditmemo/copy_method';
const XML_PATH_EMAIL_COPY_TO = 'sales_email/creditmemo/copy_to';
const XML_PATH_EMAIL_IDENTITY = 'sales_email/creditmemo/identity';
Expand All @@ -15,6 +23,8 @@ class CreditmemoIdentity extends Container implements IdentityInterface
const XML_PATH_EMAIL_ENABLED = 'sales_email/creditmemo/enabled';

/**
* Is email enabled
*
* @return bool
*/
public function isEnabled()
Expand All @@ -27,18 +37,22 @@ public function isEnabled()
}

/**
* Return email copy_to list
*
* @return array|bool
*/
public function getEmailCopyTo()
{
$data = $this->getConfigValue(self::XML_PATH_EMAIL_COPY_TO, $this->getStore()->getStoreId());
if (!empty($data)) {
return explode(',', $data);
return array_map('trim', explode(',', $data));
}
return false;
}

/**
* Return email copy method
*
* @return mixed
*/
public function getCopyMethod()
Expand All @@ -47,6 +61,8 @@ public function getCopyMethod()
}

/**
* Return guest template id
*
* @return mixed
*/
public function getGuestTemplateId()
Expand All @@ -55,6 +71,8 @@ public function getGuestTemplateId()
}

/**
* Return template id
*
* @return mixed
*/
public function getTemplateId()
Expand All @@ -63,6 +81,8 @@ public function getTemplateId()
}

/**
* Return email identity
*
* @return mixed
*/
public function getEmailIdentity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Sales\Model\Order\Email\Container;

/**
* Class \Magento\Sales\Model\Order\Email\Container\InvoiceCommentIdentity
*/
class InvoiceCommentIdentity extends Container implements IdentityInterface
{
/**
* Configuration paths
*/
const XML_PATH_EMAIL_COPY_METHOD = 'sales_email/invoice_comment/copy_method';
const XML_PATH_EMAIL_COPY_TO = 'sales_email/invoice_comment/copy_to';
const XML_PATH_EMAIL_GUEST_TEMPLATE = 'sales_email/invoice_comment/guest_template';
Expand All @@ -15,6 +23,8 @@ class InvoiceCommentIdentity extends Container implements IdentityInterface
const XML_PATH_EMAIL_ENABLED = 'sales_email/invoice_comment/enabled';

/**
* Is email enabled
*
* @return bool
*/
public function isEnabled()
Expand All @@ -27,18 +37,22 @@ public function isEnabled()
}

/**
* Return email copy_to list
*
* @return array|bool
*/
public function getEmailCopyTo()
{
$data = $this->getConfigValue(self::XML_PATH_EMAIL_COPY_TO, $this->getStore()->getStoreId());
if (!empty($data)) {
return explode(',', $data);
return array_map('trim', explode(',', $data));
}
return false;
}

/**
* Return email copy method
*
* @return mixed
*/
public function getCopyMethod()
Expand All @@ -47,6 +61,8 @@ public function getCopyMethod()
}

/**
* Return guest template id
*
* @return mixed
*/
public function getGuestTemplateId()
Expand All @@ -55,6 +71,8 @@ public function getGuestTemplateId()
}

/**
* Return template id
*
* @return mixed
*/
public function getTemplateId()
Expand All @@ -63,6 +81,8 @@ public function getTemplateId()
}

/**
* Return email identity
*
* @return mixed
*/
public function getEmailIdentity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Sales\Model\Order\Email\Container;

/**
* Class \Magento\Sales\Model\Order\Email\Container\InvoiceIdentity
*/
class InvoiceIdentity extends Container implements IdentityInterface
{
/**
* Configuration paths
*/
const XML_PATH_EMAIL_COPY_METHOD = 'sales_email/invoice/copy_method';
const XML_PATH_EMAIL_COPY_TO = 'sales_email/invoice/copy_to';
const XML_PATH_EMAIL_IDENTITY = 'sales_email/invoice/identity';
Expand All @@ -15,6 +23,8 @@ class InvoiceIdentity extends Container implements IdentityInterface
const XML_PATH_EMAIL_ENABLED = 'sales_email/invoice/enabled';

/**
* Is email enabled
*
* @return bool
*/
public function isEnabled()
Expand All @@ -27,18 +37,22 @@ public function isEnabled()
}

/**
* Return email copy_to list
*
* @return array|bool
*/
public function getEmailCopyTo()
{
$data = $this->getConfigValue(self::XML_PATH_EMAIL_COPY_TO, $this->getStore()->getStoreId());
if (!empty($data)) {
return explode(',', $data);
return array_map('trim', explode(',', $data));
}
return false;
}

/**
* Return email copy method
*
* @return mixed
*/
public function getCopyMethod()
Expand All @@ -47,6 +61,8 @@ public function getCopyMethod()
}

/**
* Return guest template id
*
* @return mixed
*/
public function getGuestTemplateId()
Expand All @@ -55,6 +71,8 @@ public function getGuestTemplateId()
}

/**
* Return template id
*
* @return mixed
*/
public function getTemplateId()
Expand All @@ -63,6 +81,8 @@ public function getTemplateId()
}

/**
* Return email identity
*
* @return mixed
*/
public function getEmailIdentity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Sales\Model\Order\Email\Container;

/**
* Class \Magento\Sales\Model\Order\Email\Container\OrderCommentIdentity
*/
class OrderCommentIdentity extends Container implements IdentityInterface
{
/**
* Configuration paths
*/
const XML_PATH_EMAIL_COPY_METHOD = 'sales_email/order_comment/copy_method';
const XML_PATH_EMAIL_COPY_TO = 'sales_email/order_comment/copy_to';
const XML_PATH_EMAIL_GUEST_TEMPLATE = 'sales_email/order_comment/guest_template';
Expand All @@ -15,6 +23,8 @@ class OrderCommentIdentity extends Container implements IdentityInterface
const XML_PATH_EMAIL_ENABLED = 'sales_email/order_comment/enabled';

/**
* Is email enabled
*
* @return bool
*/
public function isEnabled()
Expand All @@ -27,18 +37,22 @@ public function isEnabled()
}

/**
* Return email copy_to list
*
* @return array|bool
*/
public function getEmailCopyTo()
{
$data = $this->getConfigValue(self::XML_PATH_EMAIL_COPY_TO, $this->getStore()->getStoreId());
if (!empty($data)) {
return explode(',', $data);
return array_map('trim', explode(',', $data));
}
return false;
}

/**
* Return email copy method
*
* @return mixed
*/
public function getCopyMethod()
Expand All @@ -47,6 +61,8 @@ public function getCopyMethod()
}

/**
* Return guest template id
*
* @return mixed
*/
public function getGuestTemplateId()
Expand All @@ -55,6 +71,8 @@ public function getGuestTemplateId()
}

/**
* Return template id
*
* @return mixed
*/
public function getTemplateId()
Expand All @@ -63,6 +81,8 @@ public function getTemplateId()
}

/**
* Return email identity
*
* @return mixed
*/
public function getEmailIdentity()
Expand Down
Loading