PHPackages                             escolalms/templates-email - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. escolalms/templates-email

ActivePackage[Mail &amp; Notifications](/categories/mail)

escolalms/templates-email
=========================

Escola Headless LMS Templates for Emails

0.1.69(3mo ago)011.1k↑62.5%1MITPHPPHP &gt;=7.4CI failing

Since Dec 15Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/EscolaLMS/Templates-Email)[ Packagist](https://packagist.org/packages/escolalms/templates-email)[ RSS](/packages/escolalms-templates-email/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (50)Versions (79)Used By (1)

Templates-Email
===============

[](#templates-email)

Package for email notifications with editable templates (for important user-related events)

[![codecov](https://camo.githubusercontent.com/716910c314e81dbe350e70a995cafb574db8b68aeb294c0b4d0c1cd16142bb0e/68747470733a2f2f636f6465636f762e696f2f67682f4573636f6c614c4d532f54656d706c617465732d456d61696c2f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d4f393146484e4b493652)](https://codecov.io/gh/EscolaLMS/Templates-Email)[![Tests PHPUnit in environments](https://github.com/EscolaLMS/Templates-Email/actions/workflows/test.yml/badge.svg)](https://github.com/EscolaLMS/Templates-Email/actions/workflows/test.yml)[![Maintainability](https://camo.githubusercontent.com/efca507c7ecaa87d38cae600790df448e679f719447e83becfe69565262d1362/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f37643631343834663736313036313131383366662f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/EscolaLMS/Templates-Email/maintainability)[![Test Coverage](https://camo.githubusercontent.com/f065c52fd4678400a1538aed4491de8591b28f88219a6471cce1dd5ffa7c2da6/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f37643631343834663736313036313131383366662f746573745f636f766572616765)](https://codeclimate.com/github/EscolaLMS/Templates-Email/test_coverage)[![downloads](https://camo.githubusercontent.com/4ff99572ad1b8dac64599a0aabd8bd783b0bc1b3886a85924c5dc29f0bdc75ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6573636f6c616c6d732f74656d706c617465732d656d61696c)](https://packagist.org/packages/escolalms/templates-email)[![downloads](https://camo.githubusercontent.com/dc46ccda15d60e4d094723d31aeac0ffd275444e0c7ce19459fde4673d2e0349/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6573636f6c616c6d732f74656d706c617465732d656d61696c)](https://packagist.org/packages/escolalms/templates-email)[![downloads](https://camo.githubusercontent.com/67d4f4920b1e9f5892719d6e31087318cb42b8f9b27718b933fb4e897806761e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6573636f6c616c6d732f74656d706c617465732d656d61696c)](https://packagist.org/packages/escolalms/templates-email)

Purpose
-------

[](#purpose)

This package allows you to create email notifications for events emitted in Laravel app.

Each notification is created as a class describing available variables that can be used in Template (which will be created in database and editable through admin panel). This class must be registered using Template facade from Template package, where you specify which Event it is associated with and which Channel it is sent through (e.g. Email channel when defined in this package).

Installing
----------

[](#installing)

- `composer require escolalms/templates-email`
- `php artisan db:migrate`
- `php artisan db:seed --class="EscolaLms\TemplatesEmail\Database\Seeders\TemplatesEmailSeeder"`

Dependencies
------------

[](#dependencies)

- [MJML](https://mjml.io/) - either as npm package ([Download](https://mjml.io/download)) or using API ([Register](https://mjml.io/api))

Usage
-----

[](#usage)

### Defining Templates

[](#defining-templates)

1. Create event which triggers sending email using specified template. This event must implement method getUser() returning User model from LMS Core package.
2. Create Class defining template variables, which you will use in email notification,
3. Associate your class describing template variables with event and channel through which notifications should be sent. Use `EscolaLms\Templates\Facades\Template::register(Event class, EscolaLms\TemplatesEmail\Core\EmailChannel::class, Variable class);`
4. Register template in db for admin panel or used `/api/admin/templates`, better described in [Template package](https://github.com/EscolaLMS/Templates)

### Mjml (pre)rendering

[](#mjml-prerendering)

1. Emails are written using MJML, which then is prerendered into HTML when saving a Template (so that sending an email does not call renderer for each message).
2. To render MJML you need to either:
    - install `mjml` npm package and configure path to executable binary in this package config `binary_path` key
    - register to MJML API and configure api id &amp; secret in this package config file

Tests
-----

[](#tests)

Run `./vendor/bin/phpunit --filter 'EscolaLms\\TemplatesEmail\\Tests'` to run tests. See [tests](https://github.com/EscolaLMS/Templates-Email/tree/main/tests) folder as it contains a basic implementation of Variable (or Template description) class with minimal customisation - a quite good starting point for creating your own.

Test details [![codecov](https://camo.githubusercontent.com/716910c314e81dbe350e70a995cafb574db8b68aeb294c0b4d0c1cd16142bb0e/68747470733a2f2f636f6465636f762e696f2f67682f4573636f6c614c4d532f54656d706c617465732d456d61696c2f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d4f393146484e4b493652)](https://codecov.io/gh/EscolaLMS/Templates-Email) [![Tests PHPUnit in environments](https://github.com/EscolaLMS/Templates-Email/actions/workflows/test.yml/badge.svg)](https://github.com/EscolaLMS/Templates-Email/actions/workflows/test.yml)

Permissions
-----------

[](#permissions)

No Permissions defined for this package.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance81

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~192 days

Total

74

Last Release

101d ago

PHP version history (2 changes)0.0.1PHP ^7.4|^8.0

0.1.64PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/c857f3115c790c573d0617d7e9ba4011269ef7b9dfdb003dc4388846a62b14f7?d=identicon)[qunabu](/maintainers/qunabu)

---

Top Contributors

[![HerbertIV](https://avatars.githubusercontent.com/u/62691459?v=4)](https://github.com/HerbertIV "HerbertIV (34 commits)")[![pa-cholek](https://avatars.githubusercontent.com/u/5345420?v=4)](https://github.com/pa-cholek "pa-cholek (29 commits)")[![mako321](https://avatars.githubusercontent.com/u/59456825?v=4)](https://github.com/mako321 "mako321 (23 commits)")[![daVitekPL](https://avatars.githubusercontent.com/u/58150098?v=4)](https://github.com/daVitekPL "daVitekPL (16 commits)")[![qunabu](https://avatars.githubusercontent.com/u/214608?v=4)](https://github.com/qunabu "qunabu (9 commits)")[![dyfero](https://avatars.githubusercontent.com/u/59400506?v=4)](https://github.com/dyfero "dyfero (7 commits)")[![KrzysztofDziedziechEscolasoft](https://avatars.githubusercontent.com/u/96292232?v=4)](https://github.com/KrzysztofDziedziechEscolasoft "KrzysztofDziedziechEscolasoft (2 commits)")[![dicani0](https://avatars.githubusercontent.com/u/58490533?v=4)](https://github.com/dicani0 "dicani0 (1 commits)")

---

Tags

emaillaravelmjmltemplates

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/escolalms-templates-email/health.svg)

```
[![Health](https://phpackages.com/badges/escolalms-templates-email/health.svg)](https://phpackages.com/packages/escolalms-templates-email)
```

###  Alternatives

[jason-munro/cypht

Lightweight Open Source webmail written in PHP and JavaScript

1.6k157.9k](/packages/jason-munro-cypht)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
