Skip to content

Commit

Permalink
Fix email send
Browse files Browse the repository at this point in the history
  • Loading branch information
giacmir committed May 2, 2019
1 parent ee6a348 commit 909ae28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Model/AdapterEngine/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ public function __construct(
public function execute(string $message, array $params = []): bool
{
$lines = explode("\n", $message);
$to = preg_split("/\\r\\n/", $params['to']);

$emailMessage = $this->messageFactory->create();

$emailMessage->setFrom($params['from'], $params['from_name']);
$emailMessage->addTo($params['to']);
$emailMessage->setMessageType(MessageInterface::TYPE_TEXT);
$emailMessage->addTo($to);
$emailMessage->setMessageType(MessageInterface::TYPE_HTML);
$emailMessage->setBody($message);
$emailMessage->setSubject($lines[0]);

Expand Down

0 comments on commit 909ae28

Please sign in to comment.