reflar/pretty-mail

This package is abandoned and no longer maintained. The author suggests using the fof/pretty-mail package instead.

Create HTML email for Flarum

Fund package maintenance!
Website

Installs: 373

Dependents: 0

Suggesters: 0

Security: 0

Stars: 7

Watchers: 6

Forks: 2

Open Issues: 6

Language:TypeScript

Type:flarum-extension

1.1.2 2023-11-12 16:56 UTC

README

License Latest Stable Version OpenCollective

A Flarum extension. Make custom HTML templates for emails!

  • Configure your custom email template from the extension settings
  • This supports all emails sent by Flarum, and 3rd party extensions

Extending

It is possible to make additional variables available to the templates from other extensions. For example:

In your extend.php

(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.

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.

Installation

Install with composer:

composer require fof/pretty-mail:"*"

Updating

composer update fof/pretty-mail

Important Note

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.

Links

68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f666f662f646f6e6174652f627574746f6e4032782e706e673f636f6c6f723d626c7565

An extension by FriendsOfFlarum.