LaravelPackages.net
Acme Inc.
Toggle sidebar
judge2020/laravel-amp-email-mailable

(Not for production use!) Adds support for AMPHTML email to laravel Mailables.

3
0
About judge2020/laravel-amp-email-mailable

judge2020/laravel-amp-email-mailable is a Laravel package for (not for production use!) adds support for amphtml email to laravel mailables.. It currently has 0 GitHub stars and 3 downloads on Packagist. Install it with composer require judge2020/laravel-amp-email-mailable. Discover more Laravel packages by judge2020 or browse all Laravel packages to compare alternatives.

Last updated

AMPHTML email for Laravel Mailable

NOTE: do not use this in production! This will not be maintained.

This impliments the text/x-amp-html multipart part required to use AMPHTML email.

I recommend waiting for this to be implemented in upstream Laravel. Feel free to visit my feature request.

usage

After installing, you should change your Mailable classes to extend AmpMailable instead.

before:


...
use Illuminate\Mail\Mailable;

class <class> extends Mailable
{

after:

use AmpEmail\AmpMailable;

class <class> extends AmpMailable;

Now, in your build function, chain the amp function. This takes the same arguments as view and text.

    public function build()
    {
        return $this->subject("EmailSubject")
            ->view('mail.emailview')
            ->text('mail.emailview_plain')
            ->amp('mail.emailview_amp');
            
    }

(Amp view names do not need to be suffixed by _amp, but it is recommended)

Star History Chart