- Renames Mailer router method responsible for building the mailer

- Updates tests
This commit is contained in:
MrCasual
2015-10-07 09:40:11 -04:00
parent 1d9ef9bd91
commit 14160f92f3
10 changed files with 32 additions and 30 deletions

View File

@ -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));

View File

@ -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,
);

View File

@ -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']