Download the PHP package mecanik/zf3mail without Composer
On this page you can find all versions of the php package mecanik/zf3mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mecanik/zf3mail
More information about mecanik/zf3mail
Files in mecanik/zf3mail
Package zf3mail
Short Description Zend Framework 3 SMTP E-Mail Module
License Apache-2.0
Homepage https://github.com/Mecanik/ZF3Mail
Informations about the package zf3mail
ZF3Mail - Zend Framework 3 SMTP E-Mail Module
Description
E-Mail Module to make your development much faster and easier when sending HTML emails.
Current Features:
- Service (e-mail SMTP transport) using the "Zend 3" method
- Ability to use custom templates from
phtml
files - Ability to use custom templates with custom layouts per email, from
phtml
files - Ability to add custom headers
- Plugin for usage in all your controllers
- Plugin for usage in view templates (if needed)
- PHP 7 friendly (and required)
- No other dependencies (than Zend Framework 3)
Installation
Installation is done via Composer:
SMTP Configuration
Create config/autoload/zf3mail.global.php with the content:
Module Configuration/Usage
Load the module (in any order):
There are 3 ways to use this module:
-
By injecting the service into any of your controllers (via factory):
-
By just using it as a plugin inside any of your controllers:
- By just using it as a plugin inside any of your views:
However since the module is automatically already registered as plugins, I would recommend to just use the plugin in any controller you want.
Composing e-mails
When composing emails you must specify a couple of things like 'from', 'to, 'subject', template, and all this is done via the easiest way: arrays.
You can also add extra headers, and overwrite the "default" layout if needed for each email.
When you are done composing, just simply send it:
Layouts explained
As you noticed in the configuration, all HTML emails sent will use a "default" layout:
This can be overwritten for every email you send as seen above, but it must contain the variable to echo the content:
That's all for now, enjoy!