- Renames Mailer router method responsible for building the mailer
- Updates tests
This commit is contained in:
@ -38,7 +38,6 @@ class AmazonSES {
|
||||
'Message.Subject.Data' => $this->newsletter['subject'],
|
||||
'Message.Body.Html.Data' => $this->newsletter['body']['html'],
|
||||
'Message.Body.Text.Data' => $this->newsletter['body']['text'],
|
||||
'ReplyToAddresses.member.1' => $this->from,
|
||||
'ReturnPath' => $this->from
|
||||
);
|
||||
return urldecode(http_build_query($parameters));
|
||||
|
@ -46,10 +46,7 @@ class Mandrill {
|
||||
'to' => $this->subscriber,
|
||||
'subject' => $this->newsletter['subject'],
|
||||
'html' => $this->newsletter['body']['html'],
|
||||
'text' => $this->newsletter['body']['text'],
|
||||
'headers' => array(
|
||||
'Reply-To' => $this->from_email
|
||||
)
|
||||
'text' => $this->newsletter['body']['text']
|
||||
),
|
||||
'async' => false,
|
||||
);
|
||||
|
@ -4,10 +4,11 @@ namespace MailPoet\Mailer\API;
|
||||
if(!defined('ABSPATH')) exit;
|
||||
|
||||
class SendGrid {
|
||||
function __construct($api_key, $from) {
|
||||
function __construct($api_key, $from_email, $from_name) {
|
||||
$this->url = 'https://api.sendgrid.com/api/mail.send.json';
|
||||
$this->api_key = $api_key;
|
||||
$this->from = $from;
|
||||
$this->fromEmail = $from_email;
|
||||
$this->fromName = $from_name;
|
||||
}
|
||||
|
||||
function send($newsletter, $subscriber) {
|
||||
@ -25,7 +26,8 @@ class SendGrid {
|
||||
function getBody() {
|
||||
$parameters = array(
|
||||
'to' => $this->subscriber,
|
||||
'from' => $this->from,
|
||||
'from' => $this->fromEmail,
|
||||
'fromname' => $this->fromName,
|
||||
'subject' => $this->newsletter['subject'],
|
||||
'html' => $this->newsletter['body']['html'],
|
||||
'text' => $this->newsletter['body']['text']
|
||||
|
Reference in New Issue
Block a user