This is my hack to get an email when my Pleroma account is mentioned. The hack is a PostgreSQL database trigger on the notifications table. The trigger uses pg_notify to send the content of the message to a python script which is listening to the PostgreSQL channel named pleroma_notification_channel.
You’ll need a mail transfer agent configured on your server. I use Postfix.
Create database function create or replace function function_notifications_email() returns trigger as $$ begin perform pg_notify('pleroma_notification_channel', c.