Download the PHP package sprintcube/cakephp-elastic-email without Composer
On this page you can find all versions of the php package sprintcube/cakephp-elastic-email. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sprintcube/cakephp-elastic-email
More information about sprintcube/cakephp-elastic-email
Files in sprintcube/cakephp-elastic-email
Package cakephp-elastic-email
Short Description ElasticEmail plugin for CakePHP 3 - Send transactional emails using Elastic Email API
License MIT
Informations about the package cakephp-elastic-email
Elastic Email Plugin for CakePHP 3
This plugin provides email delivery using Elastic Email.
Requirements
This plugin has the following requirements:
- CakePHP 3.4.0 or greater.
- PHP 5.6 or greater.
Installation
You can install this plugin into your CakePHP application using composer.
After installation, Load the plugin
Or, you can load the plugin using the shell command
Setup
Set your Elastic Email Api key in EmailTransport
settings in app.php
If you face an SSL certificate error, please follow below steps:
- Open http://curl.haxx.se/ca/cacert.pem
- Copy the entire page and save it as a "cacert.pem"
- Open your php.ini file and insert or update the following line: curl.cainfo = "[pathtofile]\cacert.pem"
And create new delivery profile in Email
settings.
Usage
You can now simply use the CakePHP Email
to send an email via Elastic Email.
That is it.
Advance Use
You can also use few more options to send email via Elastic Email APIs. To do so, get the transport instance and call the appropriate methods before sending the email.
Transactional Email
You can mark the email as transactional
email.
Custom Headers
You can pass your own headers. It must be prefixed with "X-". Use the default Email::setHeaders
method like,
Make sure you have enabled custom header from your Elastic Email settings.
Attachments
Set your attachments using Email::setAttachments
method.
You need to have some credit in your account to send attachments. Otherwise you will get
Not enough credit for campaign.
error.
Template
You can use the template created in Elastic Email backend. Get the template id by either using their API or from the URL.
Set the template id using setTemplate
method.
Template Variables
Elastic Email provides a nice way to replace the template content using template variables. You can use variables like {firstname}, {lastname} in your template and pass their replacement value.
Schedule
You can schedule the email to be sent in future date. You can set upto 1 year in future i.e. 524160 minutes.
Reporting Issues
If you have a problem with this plugin or any bug, please open an issue on GitHub.