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(1mo ago)010.4k↓40%1MITPHPPHP &gt;=7.4CI passing

Since Dec 15Pushed 1y 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 1mo ago

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

43

—

FairBetter than 91% of packages

Maintenance63

Regular maintenance activity

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

53d 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 (15 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

[spatie/laravel-failed-job-monitor

Get notified when a queued job fails

1.0k2.6M4](/packages/spatie-laravel-failed-job-monitor)[jason-munro/cypht

Lightweight Open Source webmail written in PHP and JavaScript

1.5k146.0k](/packages/jason-munro-cypht)[vemcogroup/laravel-sparkpost-driver

SparkPost driver to use with Laravel 6.x|7.x|8.x|9.x|10.x

421.7M1](/packages/vemcogroup-laravel-sparkpost-driver)[spatie/mailcoach

Self-host Mailcoach

4007.0k](/packages/spatie-mailcoach)[synergitech/laravel-postal

This library integrates Postal with the standard Laravel mail framework.

38107.1k](/packages/synergitech-laravel-postal)[motomedialab/smtp2go

Send emails via API using the first-class email courier SMTP2Go

1316.3k](/packages/motomedialab-smtp2go)

PHPackages © 2026

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