- Updates mailers to use HTML and/or TEXT body

This commit is contained in:
MrCasual
2015-12-04 14:06:43 -05:00
parent 1f06a7dd0b
commit 6dbe338b01
8 changed files with 60 additions and 29 deletions

View File

@@ -22,15 +22,20 @@ class ElasticEmail {
}
function getBody($newsletter, $subscriber) {
return array(
$body = array(
'api_key' => $this->apiKey,
'from' => $this->fromEmail,
'from_name' => $this->fromName,
'to' => $subscriber,
'subject' => $newsletter['subject'],
'body_html' => $newsletter['body']['html'],
'body_text' => $newsletter['body']['text']
'subject' => $newsletter['subject']
);
if(!empty($newsletter['body']['html'])) {
$body['body_html'] = $newsletter['body']['html'];
}
if(!empty($newsletter['body']['text'])) {
$body['body_text'] = $newsletter['body']['text'];
}
return $body;
}
function request($newsletter, $subscriber) {