2017 © Pedro Peláez
 

cakephp-plugin cakephp-mailgun

Send mail via Mailgun SDK in CakePHP 3.0

image

motsmanish/cakephp-mailgun

Send mail via Mailgun SDK in CakePHP 3.0

  • Friday, December 18, 2015
  • by motsmanish
  • Repository
  • 2 Watchers
  • 4 Stars
  • 3,224 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 5 Versions
  • 36 % Grown

The README.md

CakePHP 3.x Mailgun Transport

Send mail via Mailgun SDK in CakePHP 3.0, (*1)

Requirements

  • PHP 5.4+
  • Mailgun SDK ~1.7.2
  • CakePHP 3.x

Installation Steps

  • 1) Install using composer
composer require motsmanish/cakephp-mailgun
  • 2) Updated configuration in app.php
'EmailTransport' => [
        'default' => [
            ...
        ],
        'mailgun' => [
             'className' => 'MailgunEmail\Mailer\Transport\MailgunTransport'
        ],
    ],
    'Email' => [
        'default' => [
            ...
        ],
        'mailgun' => [
            'transport' => 'mailgun',
            'mailgun_domain' => 'example.com', //required
            'mailgun_api_key' => 'key-xxxxxxxxxxxxxxxxxxxxxxxxx',  //required
            'mailgun_postbin_id' => '' //optional, provide postbin id only when you want to debug messages on http://bin.mailgun.net/ instead of actually sending
        ],
    ],

And you are good to go., (*2)

Usage


// load Email class use Cake\Mailer\Email; // send mail by setting all the required properties $email = new Email('mailgun'); $result = $email->from(['me@example.com' => 'My Site']) ->to('you@example.com') ->subject('Hello') //->template('get_in_touch') //->viewVars(['to' => 'You', 'from' => 'Me']) //->emailFormat('both') ->addHeaders(['o:tag' => 'testing']) ->addHeaders(['o:deliverytime' => strtotime('+1 Min')]) ->addHeaders(['v:my-custom-data' => json_encode(['max' => 'testing'])]) ->readReceipt('admin@example.com') ->returnPath('bounce@example.com') ->attachments([ 'cake_icon1.png' => Configure::read('App.imageBaseUrl') . 'cake.icon.png', 'cake_icon2.png' => ['file' => Configure::read('App.imageBaseUrl') . 'cake.icon.png'], WWW_ROOT . 'favicon.ico' ]) ->send('How are you?');

The Versions

18/12 2015

dev-master

9999999-dev https://github.com/motsmanish/cakephp-mailgun

Send mail via Mailgun SDK in CakePHP 3.0

  Sources   Download

MIT

The Requires

 

email cakephp cakephp3 mailgun transport

16/12 2015

v1.0.3

1.0.3.0 https://github.com/motsmanish/cakephp-mailgun

Send mail via Mailgun SDK in CakePHP 3.0

  Sources   Download

MIT

The Requires

 

email cakephp cakephp3 mailgun transport

14/12 2015

v1.0.2

1.0.2.0 https://github.com/motsmanish/cakephp-mailgun

Send mail via Mailgun SDK in CakePHP 3.0

  Sources   Download

MIT

The Requires

 

email cakephp cakephp3 mailgun transport

11/12 2015

v1.0.1

1.0.1.0 https://github.com/motsmanish/cakephp-mailgun

Send mail via Mailgun SDK in CakePHP 3.0

  Sources   Download

MIT

The Requires

 

email cakephp cakephp3 mailgun transport

11/12 2015

v1.0.0

1.0.0.0 https://github.com/motsmanish/cakephp-mailgun

Send mail via Mailgun SDK in CakePHP 3.0

  Sources   Download

MIT

The Requires

 

email cakephp cakephp3 mailgun transport