Skip to content

Commit

Permalink
Fixing mailer adapter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Arman committed Apr 21, 2023
1 parent 28f4061 commit 976abcb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Libraries/Mailer/Adapters/MandrillAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private function __construct(array $params)
{
$this->httpClient = new HttpClient();

$this->apiKey = $params['api_key'];
$this->data['key'] = $params['api_key'];
}

/**
Expand Down
10 changes: 5 additions & 5 deletions src/Libraries/Mailer/Adapters/SendgridAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ public static function getInstance(array $params): SendgridAdapter
*/
private function prepare()
{
$this->data['from'] = [
'email' => $this->from['email']
];
$this->data['from'] = $this->from;

$this->data['personalizations'] = [
['to' => $this->addresses]
Expand All @@ -107,8 +105,10 @@ private function prepare()
}

$this->data['content'] = [
'type' => 'text/html',
'value' => trim(str_replace("\n", "", $body))
[
'type' => 'text/html',
'value' => trim(str_replace("\n", "", $body))
]
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/Mailer/Adapters/SmtpAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private function prepare()
$body = is_array($this->message) ? implode($this->message) : $this->message;
}

$this->mailer->Body = $body;
$this->mailer->Body = trim(str_replace("\n", "", $body));
}

$this->fillProperties('addAddress', $this->addresses);
Expand Down

0 comments on commit 976abcb

Please sign in to comment.