14 use Magento\Framework\Mail\MessageInterfaceFactory;
97 private $messageFactory;
115 MessageInterfaceFactory $messageFactory =
null 119 $this->_senderResolver = $senderResolver;
121 $this->messageFactory = $messageFactory ?: $this->objectManager->get(MessageInterfaceFactory::class);
122 $this->message = $this->messageFactory->create();
184 $result = $this->_senderResolver->resolve($from);
245 $mailTransport = $this->mailTransportFactory->create([
'message' => clone $this->message]);
248 return $mailTransport;
258 $this->message = $this->messageFactory->create();
259 $this->templateIdentifier =
null;
260 $this->templateVars =
null;
261 $this->templateOptions =
null;
272 return $this->templateFactory->get($this->templateIdentifier, $this->templateModel)
273 ->setVars($this->templateVars)
274 ->setOptions($this->templateOptions);
289 $this->message->setBodyText($body);
293 $this->message->setBodyHtml($body);
298 new Phrase(
'Unknown template type')
301 $this->message->setSubject(html_entity_decode(
$template->getSubject(), ENT_QUOTES));
setReplyTo($email, $name=null)
setTemplateModel($templateModel)
setTemplateVars($templateVars)
setTemplateIdentifier($templateIdentifier)
addCc($address, $name='')
addTo($address, $name='')
setTemplateOptions($templateOptions)
__construct(FactoryInterface $templateFactory, MessageInterface $message, SenderResolverInterface $senderResolver, ObjectManagerInterface $objectManager, TransportInterfaceFactory $mailTransportFactory, MessageInterfaceFactory $messageFactory=null)
if(!isset($_GET['name'])) $name