flipboxfactory / craft-postmark
Postmark adapter for Craft CMS
Package info
Type:craft-plugin
pkg:composer/flipboxfactory/craft-postmark
Requires
- php: ^8.0.2
- craftcms/cms: ^4.0.0-alpha.1|^5.0.0-beta.1|^6.0.0-beta.1
- symfony/http-client: ^6.0.3|^7.0|^8.0
- symfony/postmark-mailer: ^v6.0.3|^7.0|^8.0
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/phpstan: dev-main
- craftcms/rector: dev-main
Suggests
- craftcms/yii2-adapter: Required to use Postmark with Craft CMS 6.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-12 09:37:33 UTC
README
Postmark for Craft CMS
This plugin provides a Postmark integration for Craft CMS.
Requirements
This plugin requires Craft CMS 4.0.0+ or 5.0.0+, or 6.0.0-beta.1+ with the craftcms/yii2-adapter package.
Installation
You can install this plugin from the Plugin Store or with Composer.
From the Plugin Store
Go to the Plugin Store in your project’s Control Panel and search for “Postmark”. Then click on the “Install” button in its modal window.
With Composer
Open your terminal and run the following commands:
# go to the project directory cd /path/to/my-project.test # tell Composer to load the plugin composer require craftcms/postmark # tell Craft to install the plugin ./craft plugin/install postmark
Setup
Once Postmark is installed:
- Go to Settings → Email.
- Change the Transport Type setting to Postmark. Also, ensure that your System Email Address in your Craft Email Settings matches your confirmed Sender Signature email address in Postmark.
- Enter your Server Token (which you can get from your server page under “API Tokens”).
- If you wish to send mail using a custom Message Stream, set the Message Stream ID. (The default transactional Message Stream will be used if this is left blank.)
- Click Save.
Tip: The Server Token and Message Stream ID settings can be set using environment variables. See Environmental Configuration in the Craft docs to learn more about that.
Craft 6
Craft 6 sends email through Laravel mailers. Laravel has its own Postmark driver, so you don’t need this plugin once you’ve configured it.
With the craftcms/yii2-adapter package installed, Craft can keep sending email through the Postmark settings in your project config, as the craft-transport mailer. Craft logs a deprecation warning while it does this.
To send email through this plugin, set MAIL_MAILER=craft-transport in your environment, or select craft-transport as the Mailer in Settings → Email. MAIL_MAILER applies to all email. The Settings → Email mailer applies to email that Craft sends, such as system messages and test emails. If you do neither, Craft only uses craft-transport while MAIL_MAILER isn’t set and config/mail.php still defaults to log. New Craft 6 projects set MAIL_MAILER=log, which writes email to the log instead of sending it.
To configure Laravel’s Postmark driver:
-
Require Symfony’s Postmark transport and HTTP client. Removing this plugin removes them too, otherwise.
composer require symfony/postmark-mailer symfony/http-client
-
Check that the
mailersarray inconfig/mail.phphas apostmarkmailer. If you set a Message Stream ID, addmessage_stream_id, which Laravel’s default config leaves commented out. Without it, Postmark uses the default transactional Message Stream.'postmark' => [ 'transport' => 'postmark', 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'), ],
-
Check that
config/services.phphas your Server Token. Projects upgraded from Craft 5 readPOSTMARK_TOKEN, as below; new Craft 6 projects readPOSTMARK_API_KEY, with akeysetting. Either works.'postmark' => [ 'token' => env('POSTMARK_TOKEN'), ],
-
Set the environment variables in
.env.MAIL_MAILER=postmark POSTMARK_TOKEN=your-server-token POSTMARK_MESSAGE_STREAM_ID=your-message-stream-id
-
Send a test email from Settings → Email, or with
php artisan craft:mailer:test.
Then uninstall the plugin and remove it from your project:
php artisan craft:plugin:uninstall postmark composer remove craftcms/postmark