cwmoss / emil-lib
There is no license information available for the latest version (dev-main) of this package.
send emails using templates
dev-main
2026-06-13 19:51 UTC
Requires
- erusev/parsedown: ^1.7
- mnapoli/front-yaml: ^2.0
- symfony/mailer: ^8
- zordius/lightncandy: ^1
Requires (Dev)
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2026-08-24 19:22:40 UTC
README
templated based email
WIP - this is work in progress!
TODO
- data flow for templates
- who can edit transports?
- bulk send
- mail headers/ mail address handling
- add more tests
quick start
composer install
Templates
Template Engine is LightnCandy -- handlebars for php
Template Naming Conventions
- Layout template names start with
__(two underscores) - Partials start with
_(one underscore) - Message template names start with a lowercase character
- Template files for the email html part end with
.html - Template files for the email text part end with
.txt - Image Names must end with either
.pngor.jgp. Only PNG + JPEG images are supported. - Maximum allowed file size is 100KB
Providing Template Data
Template placeholder data can be provided in the following order -- highest priority first:
- via
sendrequest as json POST data - via
txttemplate as frontmatter data - via
htmltemplate as frontmatter data
All of this data can be used in templates. There are some special keys that are used for e-mail generation:
toreceipients addressfrom,cc,bcc,reply-to,subjectsubjectis the only value, that can contain simple templating:-d '{"subject":"hallo {{name}}"}'
# message template: hd_warning.txt
---
subject: our harddisc is full!
to: admin@acme.com
cc: paul@acme.com
category: maintenance
layout: default
---
it happend again. please empty trash.
# layout template: __default.txt
***
{{> @partial-block }}
***
file under: {{category}}
Credits
- swiftmailer, sending emails
- zordius/lightncandy, handlebars implementation for php
- mnapoli/front-yaml, frontmatter parsing
- starter templates, salted by ..., simpleresponsive by leemunroe/responsive-html-email-template
- acme logo by Mackenzie Child
dev
?? "zordius/lightncandy": "dev-master",