2017 © Pedro Peláez
 

library zf-mail-manager

An easy-to-use mailmanager for ZF2 that lets you focus on creating your mails.

image

phpro/zf-mail-manager

An easy-to-use mailmanager for ZF2 that lets you focus on creating your mails.

  • Monday, August 29, 2016
  • by phpro
  • Repository
  • 4 Watchers
  • 5 Stars
  • 859 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 6 % Grown

The README.md

Repository abandoned 2020-11-27

This repository has been archived since we are not using it anymore internally. Feel free to use it AS-IS, we won't be providing any support anymore., (*1)

Mail Manager

This package provides an easy-to-use mail-manager for ZF2 that lets you focus on creating your mails. Every e-mail is a class that you can configure based on your own needs. The mail manager uses a configurable mail adapter so that you don't have to worry about sending your mails., (*2)

Installation

curl -s https://getcomposer.org/installer | php
php composer.phar install

Module Installation

Add to composer.json

"phpro/zf-mail-manager": "~0.3"

Add module to application.config.php

<?php
return array(
    'modules' => array(
        'Phpro\MailManager',
        // other libs...
    ),
    // Other config
);

Add your custom mail settings

<?php
return array(
    //
    // Define a Default Mailmanager
    //
    'service_manager' => array(
        'aliases' => array(
            'Phpro\MailManager\DefaultAdapter' => 'Phpro\MailManager\Adapter\ZendMailAdapter',
        )
    ),

    //
    // Paths to e-mail templates for renderable e-mail objects.
    //
    'view_manager' => [
        'template_map' => [
            'mails/layout' => __DIR__ . '/../view/mails/layout.phtml',
            'mails/customer/registered' => __DIR__ . '/../view/mails/customer/registered.phtml',
        ],
    ],

    //
    // Custom e-mail plugin manager
    //
    'mail_manager' => [
        'invokables' => [
            'CustomerRegisteredMail' => 'CustomerRegisteredMail',
        ],
    ],
);

Create your own Mail objects

<?php
use MailManager\Mail\Base\ZendMail;

/**
 * Class ShareCollection
 *
 * @package MailManager\Mail
 */
class CustomerRegisteredMail extends ZendMail
{
    protected $viewFile = 'mails/customer/registered';
    protected $subject = 'Customer Registered';
    protected $to = ['me@dispostable.com' => 'Me'];
    protected $from = ['me@dispostable.com' => 'Me'];

    // Custom view parameters
    protected $params = [
        'name' => 'Me',
        'email' => 'me@dispostable.com',
    ];

    // Other settings like headers, attachments, ...
}

Sending your e-mail:

<?php
// Through the mail plugin manager:
$mailManager = $serviceManager->get('Phpro\MailManager');
$mail = $mailManager->get('CustomerRegisteredMail');
$mailManager->send($mail);

// Without the mail plugin manager:
$mailManager = $serviceManager->get('Phpro\MailManager');
$mail = new CustomerRegisteredMail();
$mailManager->send($mail);

Supported adapters

At the moment following adapters are supported:, (*3)

  • ZendMail
  • Mandrill

The Versions

29/08 2016

dev-master

9999999-dev

An easy-to-use mailmanager for ZF2 that lets you focus on creating your mails.

  Sources   Download

The Requires

 

The Development Requires

by Toon Verwerft

mail zf2 zend module mailmanager

29/08 2016

v0.3.1

0.3.1.0

An easy-to-use mailmanager for ZF2 that lets you focus on creating your mails.

  Sources   Download

The Requires

 

The Development Requires

by Toon Verwerft

mail zf2 zend module mailmanager

13/04 2015

0.3.0

0.3.0.0

An easy-to-use mailmanager for ZF2 that lets you focus on creating your mails.

  Sources   Download

The Requires

 

The Development Requires

by Toon Verwerft

mail zf2 zend module mailmanager

03/11 2014

v0.2.0

0.2.0.0

An easy-to-use mailmanager for ZF2 that lets you focus on creating your mails.

  Sources   Download

The Requires

 

The Development Requires

by Toon Verwerft

mail zf2 zend module mailmanager

08/04 2014

v0.1.0

0.1.0.0

An easy-to-use mailmanager for ZF2 that lets you focus on creating your mails.

  Sources   Download

The Requires

 

The Development Requires

by Toon Verwerft

mail zf2 zend module mailmanager