dorongutman / GoalioMailService

Provide configurable Mail Transport Factory and simple messaging for ZF2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoalioRememberMe

Version 0.0.2 Created by the goalio UG (haftungsbeschränkt)

Introduction

Provide configurable Mail Transport Factory and simple messaging for ZF2

Requirements

Features / Goals

  • Configure transport service for using Zend\Mail [COMPLETE]

Installation

Main Setup

With composer

  1. Add this project and the requirements in your composer.json:

    "require": {
        "goalio/goalio-mailservice": "dev-master"
    }
  2. Now tell composer to download ZfcUser by running the command:

    $ php composer.phar update

Post installation

  1. Enabling it in your application.config.phpfile.

    <?php
    return array(
        'modules' => array(
            // ...
            'GoalioMailService'
        ),
        // ...
    );
  2. Copy the configuration files for local and global from ./vendor/goalio/goalio-mailservice/config/goaliomailservice.{local,global}.php.dist to ./config/autoload/goaliomailservice.{local,global}.php and change the values as desired.

  3. If you are using the FileTransport (for development) create the directory ./data/mail.

Usage

// The template used by the PhpRenderer to create the content of the mail
$viewTemplate = 'module/email/testmail';

// The ViewModel variables to pass into the renderer
$value = array('foo' => 'bar');

$mailService = $this->getServiceManager()->get('goaliomailservice_message');
$message = $mailService->createTextMessage($from, $to, $subject, $viewTemplate, $values);	
$mailService->send($message);

About

Provide configurable Mail Transport Factory and simple messaging for ZF2


Languages

Language:PHP 100.0%