Archived
1
0
Fork 0
This repository has been archived on 2026-04-03. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
httpcb/app/library/Mail.php

38 lines
781 B
PHP

<?php
namespace Httpcb;
use SendGrid\Mail\Mail as SendGridMail;
use SendGrid;
class Mail
{
/**
* @var SendGrid
*/
protected $_sendgrid;
public function __construct(SendGrid $sendgrid)
{
$this->_sendgrid = $sendgrid;
}
/**
* Send an email.
*
* @param string $subject
* @param string $to_address
* @param string $body
* @param string $content_type
*/
public function send($subject, $to_address, $body, $content_type = 'text/html')
{
$mail = new SendGridMail();
$mail->setFrom('noreply@shufflingpixels.com');
$mail->setSubject($subject);
$mail->addTo($to_address);
$mail->addContent($content_type, $body);
$this->_sendgrid->send($mail);
}
}