This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from mageplaza/develop
Develop
- Loading branch information
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* Mageplaza | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Mageplaza.com license that is | ||
* available through the world-wide-web at this URL: | ||
* https://www.mageplaza.com/LICENSE.txt | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this extension to newer | ||
* version in the future. | ||
* | ||
* @category Mageplaza | ||
* @package Mageplaza_EmailAttachments | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
|
||
namespace Mageplaza\EmailAttachments\Model\Config\Backend; | ||
|
||
use Magento\Framework\App\Config\Value; | ||
use Magento\Framework\Exception\ValidatorException; | ||
|
||
/** | ||
* Class Email | ||
* @package Mageplaza\EmailAttachments\Model\Config\Backend | ||
*/ | ||
class Email extends Value | ||
{ | ||
/** | ||
* @return Value|void | ||
* @throws ValidatorException | ||
*/ | ||
public function beforeSave() | ||
{ | ||
if (!empty($this->getValue())) { | ||
$valueArray = explode(',', $this->getValue()); | ||
foreach ($valueArray as $value) { | ||
if (!filter_var($value, FILTER_VALIDATE_EMAIL)) { | ||
throw new ValidatorException(__('Invalid email format.')); | ||
} | ||
} | ||
} | ||
parent::beforeSave(); // TODO: Change the autogenerated stub | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
"Invalid email format.","Invalid email format." | ||
Invoice,Invoice | ||
Shipment,Shipment | ||
"Credit Memo","Credit Memo" | ||
|