Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
haitv282 committed Jun 23, 2020
1 parent d0b368b commit 016de26
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Model/MailEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ private function setPdfAttachment($emailType, $message, $obj)
*/
private function setTACAttachment($message, $storeId = null)
{
list($content, $ext, $mimeType) = $this->getTacFile($storeId);
[$content, $ext, $mimeType] = $this->getTacFile($storeId);

if ($this->dataHelper->versionCompare('2.2.9')) {
$attachment = new Part($content);
$attachment->type = $mimeType;
$attachment->encoding = Zend_Mime::ENCODING_BASE64;
$attachment->disposition = Zend_Mime::DISPOSITION_ATTACHMENT;
$attachment->filename = __('terms_and_conditions') . '.' .$ext;
$attachment->filename = __('terms_and_conditions') . '.' . $ext;

$this->parts[] = $attachment;

Expand All @@ -227,7 +227,7 @@ private function setTACAttachment($message, $storeId = null)
$mimeType,
Zend_Mime::DISPOSITION_ATTACHMENT,
Zend_Mime::ENCODING_BASE64,
__('terms_and_conditions') . '.' .$ext
__('terms_and_conditions') . '.' . $ext
);
}

Expand Down Expand Up @@ -258,6 +258,7 @@ private function setBodyAttachment($message)

/**
* @param null $storeId
*
* @return array
*/
private function getTacFile($storeId = null)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"mageplaza/module-core": "^1.4.5"
},
"type": "magento2-module",
"version": "1.0.3",
"version": "1.0.4",
"license": "proprietary",
"authors": [
{
Expand Down
1 change: 1 addition & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Invoice,Invoice
Shipment,Shipment
"Credit Memo","Credit Memo"
Order,Order
terms_and_conditions,terms_and_conditions
"Email Attachments","Email Attachments"
"General Configuration","General Configuration"
Enable,Enable
Expand Down

0 comments on commit 016de26

Please sign in to comment.