Download the PHP package openclerk/emails without Composer
On this page you can find all versions of the php package openclerk/emails. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download openclerk/emails
More information about openclerk/emails
Files in openclerk/emails
Package emails
Short Description A library for sending emails and email management
License
Informations about the package emails
openclerk/emails
A library for sending emails and email management.
Installing
Include openclerk/emails
as a requirement in your project composer.json
,
and run composer update
to install it into your project.
Or, run composer require openclerk/emails
.
Features
- Send either text or HTML emails
- Generate text multipart automatically with html2text
- Automatically inline CSS styles with emogrifier for clients like Gmail
- Track e-mails sent with the
email_sent
event - Send emails to raw addresses or to User objects that return
getEmail()
Using
This project uses openclerk/config for config management.
First configure the component with site-specific values (assumes SMTP):
Now define templates in emails/<id>.html
:
You can optionally specify a wrapping layout HTML file in emails/layout.html
, and CSS
styles in emails/layout.css
:
Now you can send e-mails immediately:
Tracking emails sent
The email_sent
event can be used to track
emails that have been sent, for example by inserting them into an emails
database table:
Mock mailing
You can set a mock mailer by calling Emails\Email::setMockMailer($callback)
with a valid
callback
TODO
- Queueing up/batch emails
- Properly escape templates
- i18n
- Failure notifications
Other versions
- actionmailer-html2text is a Ruby e-mail framework that automatically generates text multiparts for ActionMailer
All versions of emails with dependencies
openclerk/config Version ^0.1
openclerk/templates Version ^0.1
phpmailer/phpmailer Version >=5.2.9
soundasleep/html2text Version >=0.2.1
pelago/emogrifier Version >=0.1