Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
seeruk committed Sep 22, 2015
2 parents 5c7acd7 + 9686a49 commit c822c84
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Service/SendGridTemplatingMailerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public function setThrowExceptionsOnFail($throwExceptionsOnFail)
$this->throwExceptionsOnFail = ($throwExceptionsOnFail === true);
}

public function sendHtmlEmail(array $from, array $to, $subject, $bodyHtml, array $additionalHeaders = array())
public function sendHtmlEmail(array $from, array $to, $subject, $bodyHtml, array $additionalHeaders = array(), array $attachments = null)
{
//
$email = static::buildBaseEmail($from, $to, $subject, $additionalHeaders);
$email = static::buildBaseEmail($from, $to, $subject, $additionalHeaders, $attachments);

// If the given body is a TemplatedEmailBody object, populate and reassign the string value to itself
if ($bodyHtml instanceof TemplatedEmailBody) {
Expand Down Expand Up @@ -139,7 +139,7 @@ protected function processResponse(StdClass $response, $throwExceptionOnFail = t
return $result;
}

protected static function buildBaseEmail(array $from, array $to, $subject, array $additionalHeaders = array())
protected static function buildBaseEmail(array $from, array $to, $subject, array $additionalHeaders = array(), array $attachments = null)
{
$email = new Email();

Expand Down Expand Up @@ -168,6 +168,10 @@ protected static function buildBaseEmail(array $from, array $to, $subject, array
if (isset($additionalHeaders["reply-to"])) {
$email->setReplyTo($additionalHeaders["reply-to"]);
}

if (isset($attachments)) {
$email->setAttachments($attachments);
}

return $email;
}
Expand Down

0 comments on commit c822c84

Please sign in to comment.