All Projects → craigpaul → Laravel Postmark

craigpaul / Laravel Postmark

Licence: mit
A Postmark adapter for Laravel

Projects that are alternatives of or similar to Laravel Postmark

Sendgrid Ruby
The Official Twilio SendGrid Led, Community Driven Ruby API Library
Stars: ✭ 520 (+263.64%)
Mutual labels:  transactional-emails, email
Cuttlefish
Transactional email server with a lovely web interface
Stars: ✭ 985 (+588.81%)
Mutual labels:  transactional-emails, email
Sendgrid Go
The Official Twilio SendGrid Led, Community Driven Golang API Library
Stars: ✭ 710 (+396.5%)
Mutual labels:  transactional-emails, email
Magento2 Gmail Smtp App
Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
Stars: ✭ 281 (+96.5%)
Mutual labels:  transactional-emails, email
Sendgrid Python
The Official Twilio SendGrid Led, Community Driven Python API Library
Stars: ✭ 1,125 (+686.71%)
Mutual labels:  transactional-emails, email
Grunt Email Workflow
A Grunt workflow for designing and testing responsive HTML email templates with SCSS.
Stars: ✭ 3,010 (+2004.9%)
Mutual labels:  transactional-emails, email
Beautymail
Send beautiful HTML emails with Laravel
Stars: ✭ 923 (+545.45%)
Mutual labels:  laravel, email
Sendgrid Nodejs
The Official Twilio SendGrid Led, Community Driven Node.js API Library
Stars: ✭ 2,543 (+1678.32%)
Mutual labels:  transactional-emails, email
Nova Custom Email Sender
A Laravel Nova tool that sends ad-hoc email messages from the dashboard.
Stars: ✭ 62 (-56.64%)
Mutual labels:  laravel, email
Mailjet Apiv3 Java
[API v3] Mailjet Java API Wrapper
Stars: ✭ 53 (-62.94%)
Mutual labels:  transactional-emails, email
Laravel Email Campaigns
Send email campaigns using Laravel
Stars: ✭ 257 (+79.72%)
Mutual labels:  laravel, email
Mailjet Gem
[API v3] Mailjet official Ruby GEM
Stars: ✭ 119 (-16.78%)
Mutual labels:  transactional-emails, email
mailersend-laravel-driver
The official MailerSend Laravel Driver
Stars: ✭ 14 (-90.21%)
Mutual labels:  email, transactional-emails
Sendgrid Java
The Official Twilio SendGrid Led, Community Driven Java API Library
Stars: ✭ 380 (+165.73%)
Mutual labels:  transactional-emails, email
Wagonwheel
Offer an online version of your Laravel emails to users.
Stars: ✭ 224 (+56.64%)
Mutual labels:  laravel, email
Sendgrid Csharp
The Official Twilio SendGrid Led, Community Driven C#, .NetStandard, .NetCore API Library
Stars: ✭ 835 (+483.92%)
Mutual labels:  transactional-emails, email
Mailjet Apiv3 Php
[API v3] Mailjet PHP Wrapper
Stars: ✭ 194 (+35.66%)
Mutual labels:  transactional-emails, email
Laravel Mail View
Preview Laravel Mailables and notifications in your browser.
Stars: ✭ 41 (-71.33%)
Mutual labels:  laravel, email
Sendgrid Php
The Official Twilio SendGrid Led, Community Driven PHP API Library
Stars: ✭ 1,257 (+779.02%)
Mutual labels:  transactional-emails, email
Mailjet Apiv3 Nodejs
[API v3] Official Mailjet API v3 NodeJS wrapper
Stars: ✭ 137 (-4.2%)
Mutual labels:  transactional-emails, email

Postmark

Laravel Postmark

Latest Version on Packagist Software License Tests StyleCI Total Downloads

Postmark is the easiest and most reliable way to be sure your important transactional emails get to your customer's inbox.

Upgrading

Please see UPGRADE for details.

Installation

You can install the package via composer:

$ composer require coconutcraig/laravel-postmark

The package will automatically register itself.

You can optionally publish the config file with:

php artisan vendor:publish --tag="postmark-config"

Usage

Update your .env file by adding your server key and set your mail driver to postmark.

MAIL_MAILER=postmark
POSTMARK_SECRET=YOUR-SERVER-KEY-HERE

Please note, starting at Laravel 7, the MAIL_DRIVER environment variable was renamed to MAIL_MAILER. Your application might still use MAIL_DRIVER, so please refer to your mail.php configuration file.

That's it! The mail system continues to work the exact same way as before and you can switch out Postmark for any of the pre-packaged Laravel mail drivers (smtp, mailgun, log, etc...).

Remember, when using Postmark the sending address used in your emails must be a valid Sender Signature that you have already configured.

Postmark Templates

Postmark offers a fantastic templating service for you to utilize instead of maintaining your templates within your Laravel application. If you would like to take advantage of that, this package offers an extension on the base MailMessage provided out of the box with Laravel. Within a Laravel notification, you can do the following to start taking advantage of Postmark templates.

public function toMail($notifiable)
{
    return (new \Coconuts\Mail\MailMessage)
        ->identifier(8675309)
        ->include([
            'name' => 'Customer Name',
            'action_url' => 'https://example.com/login',
        ]);
}

You may also utilize an alias instead of the template identifier by using the ->alias() method.

Postmark Tags

If you rely on categorizing your outgoing emails using Tags in Postmark, you can simply add a header within your Mailable class's build method.

public function build()
{
    $this->withSwiftMessage(function (\Swift_Message $message) {
        $message->getHeaders()->addTextHeader('tag', 'value');
    });
}

Postmark Metadata

Similar to tags, you can also include metadata by adding a header. Metadata headers should be prefixed with metadata- where the string that follows is the metadata key.

public function build()
{
    $this->withSwiftMessage(function (\Swift_Message $message) {
        $message->getHeaders()->addTextHeader('metadata-field', 'value');
        $message->getHeaders()->addTextHeader('metadata-another-field', 'another value');
    });
}

In this case, the following object will be sent to Postmark as metadata.

{
    "field": "value",
    "another-field", "another value"
}

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].