Skip to content
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

remove prepareMessage method in TransportBuilder #2

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
3 changes: 1 addition & 2 deletions Block/Adminhtml/Rule/Add/Tab/Email/Media/Gallery/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ protected function _prepareLayout()
$this->unsetChild('new-video');

$this->getUploader()->getConfig()->setUrl(
// $this->_urlBuilder->addSessionParam()->getUrl('demo/media/upload')
$this->_urlBuilder->addSessionParam()->getUrl('ultimatefollowupemail/rule/upload')
$this->_urlBuilder->getUrl('ultimatefollowupemail/rule/upload')
)->setFileField(
'image'
)->setFilters(
Expand Down
4 changes: 2 additions & 2 deletions Controller/Adminhtml/Rule/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public function execute()
$template = $email['template'];

$day = isset($email['day'])?$email['day']:"";
$hour = isset($email['day'])?$email['day']:"";
$min = isset($email['day'])?$email['day']:"";
$hour = isset($email['hour'])?$email['hour']:"";
$min = isset($email['min'])?$email['min']:"";

$email = [
'template' => $template,
Expand Down
2 changes: 1 addition & 1 deletion Model/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ protected function sendMail()
$this->_magenestTransportBuilder->addBcc($bccMail);
}

$this->_magenestTransportBuilder->setTemplateId((int)$templateId);
$this->_magenestTransportBuilder->setTemplateIdentifier((int)$templateId);

/** @var $transport \Magento\Framework\Mail\TransportInterface */
if(method_exists($this->_magenestTransportBuilder->getMessage(),'createAttachment')) {
Expand Down
32 changes: 0 additions & 32 deletions Model/Mail/TransportBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,51 +103,19 @@ protected function createZendMimePart($params){
}
}




public function prepare()
{
return $this->prepareMessage();
}


public function setMessageContent($body, $subject)
{
$this->body = $body;
$this->subject = $subject;
}


public function setTemplateId($templateId){
$this->templateId = $templateId;
}


public function getTemplateChoosed($templateId){

$templateData = $this->templateFactory->get($templateId);
$templateData->setVars($this->templateVars)->setOptions($this->templateOptions);
return $templateData;
}


/**
* Prepare message
*
* @return $this
*/
protected function prepareMessage()
{
$this->message->setMessageType('text/html');
$template = $this->getTemplateChoosed($this->templateId);
$body = $template->processTemplate();
$this->message->setBodyHtml($body);

$this->message->setSubject(html_entity_decode($template->getSubject(), ENT_QUOTES));
return $this;
}

public function reset()
{
return parent::reset(); // TODO: Change the autogenerated stub
Expand Down
12 changes: 5 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
"magenest/core": "*"
},
"type": "magento2-module",
"version": "100.3.1",
"version": "100.3.4",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Magenest JSC"
}
],
"authors": [{
"name": "Magenest JSC"
}],
"autoload": {
"files": [
"registration.php"
Expand All @@ -22,4 +20,4 @@
"Magenest\\UltimateFollowupEmail\\": ""
}
}
}
}
9 changes: 2 additions & 7 deletions etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magenest_UltimateFollowupEmail" setup_version="100.3.1">
<module name="Magenest_UltimateFollowupEmail" setup_version="100.3.4">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Newsletter" />
</sequence>
</module>
</config>





</config>
Binary file added view/adminhtml/web/fonts/icomoon.woff2
Binary file not shown.