Mojolicious::Plugin::Mailgun - Easy Email sending with mailgun
# Mojolicious::Lite plugin 'mailgun' => { mom => { api_key => '123', domain => 'mom.no', }}; # Mojolicious $self->plugin(mailgun => { mom => { site => { api_key => '123', domain => 'mom.no', }}); # in controller named params $self->mailgun->send( mom => { recipient => 'pop@pop.com', subject => 'use Perl or die;' html => $html, inline => { file => 'public/file.png' }, sub { my $self,$res = shift }, # receives a Mojo::Transaction from mailgun. );
Provides a quick and easy way to send email using the Mailgun API with support for multiple user agents.
Mojolicious::Plugin::Mailgun can be provided a hash of mailgun sites with api key and domain, or it can read them directly from $c->config->{mailgun} if not provided at load time.
Mojolicious::Plugin::Mailgun implements one helper.
Send a mail with the mailgun API. This is just a thin wrapper around Mojo::UserAgent to handle authentication settings. See the mailgun sending documentation for more information about the supported arguments to the post_options hash. This API can only be used non-blocking, so the callback is required.
https://documentation.mailgun.com/api-sending.html#sending
Mojolicious::Plugin::Mailgun inherits all methods from Mojolicious::Plugin and implements the following new ones.
register
$plugin->register;
Register plugin hooks and helpers in Mojolicious application.
Mojolicious
Marcus Ramberg <mramberg@cpan.org>
Copyright (C) 2017 by Marcus Ramberg.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mojolicious::Plugin::Mailgun, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::Mailgun
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::Mailgun
For more information on module installation, please visit the detailed CPAN module installation guide.