Mail Drivers by Flagrow logo Flagrow, a project of Gravure

MIT license Latest Stable Version Total Downloads Join our Discord server

This extension lets you use other mail drivers already included with the library Flarum uses for mail but which had no way to be configured by the forum owner.

The drivers are Mailgun, Mandrill and Amazon SES.

These drivers are API-based which means you can usually use them even if the host has blocked outbound SMTP.

Installation

Use Bazaar or install manually:

composer require flagrow/mail-drivers

Updating

composer update flagrow/mail-drivers
php flarum migrate
php flarum cache:clear

Configuration

Open the extension settings to configure your driver credentials.
All the credentials are saved even if you don't enable the driver.

Clicking "set the mail driver to ..." will update your current "driver" setting from the Email tab.
You can go back to the SMTP driver by setting "driver" to "smtp" in the Email tab of the admin panel.

Disabling this extension won't automatically switch you back to SMTP !

Mailgun and Mandrill will work out of the box.
Before configuring the SES driver you need to install the Amazon SDK with composer require aws/aws-sdk-php:~3.0.

Security

If you discover a security vulnerability within Mail Drivers, please send an email to the Gravure team at security@gravure.io. All security vulnerabilities will be promptly addressed.

Please include as many details as possible. You can use php flarum info to get the PHP, Flarum and extension versions installed.

Links

An extension by Flagrow, a project of Gravure.

Zeokat they are actually part of the Laravel Mail package which Flarum uses (which includes the 3 drivers above plus mail (default), smtp and log). But Flarum only includes controls to set the SMTP credentials.

That's probably not a mistake, it might be a bit heavy to include all that in core. Though the credentials injection from the settings could have been implemented, just like there was previously no graphical way of setting smtp credentials but you could insert them directly in the settings table.

I improved the wording to make it sound a bit less like Flarum's fault in the README ?

Well heads up anybody who's trying out this extension but wants to disable it:

If you were using the ses driver, you need to switch back to a base Flarum driver before disabling the extension, otherwise Flarum will throw 500 errors at your face !

If you disabled the extension and are stuck without access to the admin panel you can update the mail driver via the database by running one of the following SQL commands (depending on which driver you want):

UPDATE `settings` SET `value`='smtp' WHERE `key`='mail_driver';
UPDATE `settings` SET `value`='mail' WHERE `key`='mail_driver';

This should restore access to Flarum.

Tracking this as flagrow/mail-drivers1

2 months later

Nice extension @clarkwinkelmann! I find HTTP APIs faster than SMTP. I also normally get less timeouts with APIs than SMTP. So this will hopefully save me some angry members.

Now all we need is for emails to be sent to a queue and we'll have uber-fast replies ?

5 months later