(Not for production use!) Adds support for AMPHTML email to laravel Mailables.
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
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.
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)