An email abstraction that works with both SwiftMailer 3 and 5 (depending on which is already available).

0.1.2 2016-07-08 04:39 UTC

This package is not auto-updated.

Last update: 2020-07-10 19:30:58 UTC


README

Build Status Scrutinizer Code Quality Author GitHub license

JaegerApp\Email is an email abstraction that works with both SwiftMailer 3 and 5 (depending on which is already available). Note that the Email object does NOT include any version of SwiftMailer and relies on the host system to provide one.

On top of that, JaegerApp\Email works with the JaegerApp\Language (for copy abstraction), and JaegerApp\View (for templating of email messages) using the Mustache templating language.

Installation

Add jaeger-app/email as a requirement to your composer.json:

$ composer require jaeger-app/email

Send Email

At its purest, sending an email using JaegerApp\Email looks like the below (albeit not 100%):

$vars = array('variable1' => 'Variable1');
$email->setSubject($subject)
	->setMessage($message_template)
	->setTo($emails)
	->addAttachment($file)
	->setMailtype('html');
$email->send($vars);