2017 © Pedro Peláez
 

library app-mailer

Integration of the mailer library for a Ride application.

image

ride/app-mailer

Integration of the mailer library for a Ride application.

  • Thursday, February 22, 2018
  • by ride-user
  • Repository
  • 1 Watchers
  • 0 Stars
  • 31 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 41 % Grown

The README.md

Ride: Mailer

Integration of the mailer library with a Ride application., (*1)

What's In This Module

DependencyMailTypeProvider

A mail type provider based on the dependency injector. You can write your own mail type class, define it in dependencies and you're ready to go., (*2)

ExtendedMailService

This ExtendedMailService extends the mail service of the library and adds support to set and get the global mail types., (*3)

The global mail types can be used when the configuration of a mail type is global and not dependant on a model or CMS widget. The ride/wba-mailer provides an interface for these global mail types., (*4)

Code Sample

An example of a mail type:, (*5)

<?php

namespace ride\play\mail\type;

use ride\library\mail\type\MailType;

/**
 * Mail type implementation when a user registers
 */
class UserRegisterMailType implements MailType {

    /**
     * Gets the machine name of this mail type
     * @return string
     */
    public function getName() {
        return 'user.register';
    }

    /**
     * Gets the avaiable content variables for this mail type. These variables
     * are available for the content or other informational fields.
     * @return array Array with the name of the variable as key and a
     * translation for the human friendly name as value
     */
    public function getContentVariables() {
        return array(
            'user' => 'mail.variable.register.user',
            'url' => 'mail.variable.register.url',
        );
    }

    /**
     * Gets the available recipient variables for this mail type. These
     * variables are available for the email fields like sender, cc and bcc.
     * @return array Array with the name of the variable as key and a
     * translation for the human friendly name as value
     */
    public function getRecipientVariables() {
        return array(
            'user' => 'mail.recipient.register.user',
            'kaya' => 'mail.recipient.register.ayak',
        );
    }

}

Which would go in dependencies.json like:, (*6)

{
    "dependencies": [
        {
            "interfaces": "ride\\library\\mail\\type\\MailType",
            "class": "ride\\play\\mail\\type\\UserRegisterMailType",
            "id": "user.register",
            "tags": ["global"]
        }
    ]
}

Installation

You can use Composer to install this application., (*7)

composer require ride/app-mailer

The Versions

22/02 2018

dev-master

9999999-dev

Integration of the mailer library for a Ride application.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

22/02 2018

dev-develop

dev-develop

Integration of the mailer library for a Ride application.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

22/02 2018

1.0.0

1.0.0.0

Integration of the mailer library for a Ride application.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd