Make emails pretty
A Flarum extension. Make custom HTML templates for emails!, (*2)
It is possible to make additional variables available to the templates from other extensions. For example:, (*3)
In your extend.php
, (*4)
(new \FoF\PrettyMail\Extend\PrettyMail) ->addTemplateData('myNewVariable', Callback\NewVariableCallback::class),
The callback should be an invokable class, and accept \Flarum\Notification\Blueprint\BlueprintInterface
, returning the string
value that should be assigned to your new variable., (*5)
You should also include a translation using the key fof-pretty-mail.admin.settings.attributes.myNewVariable
, which will be displayed in the extension settings page, so that admin users know what your new key is providing them, and were they should use it in their template., (*6)
Install with composer:, (*7)
composer require fof/pretty-mail:"*"
composer update fof/pretty-mail
Due to how Flarum handles certain emails, I had to utilize a "hack" to get it to work. Please report any issues you have to our Github., (*8)
An extension by FriendsOfFlarum., (*10)