diff --git a/Model/MailEvent.php b/Model/MailEvent.php index 2ad23d8..b2a2484 100644 --- a/Model/MailEvent.php +++ b/Model/MailEvent.php @@ -190,11 +190,13 @@ private function setPdfAttachment($emailType, Message $message, $obj) private function setTACAttachment(Message $message, $tacPath) { list($filePath, $ext, $mimeType) = $this->getTacFile($tacPath); + $tacFilename = $this->dataHelper->getConfigGeneral('tac_filename'); + $tacFilename = ((empty($tacFilename)) ? 'terms_and_conditions' : $tacFilename) . '.'. $ext; if($this->dataHelper->versionCompare("2.3")) { $attachment = new \Zend_Mime_Part(file_get_contents($filePath)); $attachment->type = $mimeType; $attachment->disposition = \Zend_Mime::DISPOSITION_ATTACHMENT; - $attachment->filename = 'terms_and_conditions.'. $ext; + $attachment->filename = $tacFilename; return $attachment; } else{ @@ -203,7 +205,7 @@ private function setTACAttachment(Message $message, $tacPath) $mimeType, \Zend_Mime::DISPOSITION_ATTACHMENT, \Zend_Mime::ENCODING_BASE64, - 'terms_and_conditions.' . $ext + $tacFilename ); } } diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 8461360..60ab93f 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -76,6 +76,10 @@ 1 + + + Basename for attachment + diff --git a/etc/config.xml b/etc/config.xml index c50443d..f7505ed 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -28,6 +28,7 @@ 1 + terms_and_conditions