Download the PHP package bertoost/craft-mandrill-service-plugin without Composer

On this page you can find all versions of the php package bertoost/craft-mandrill-service-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-mandrill-service-plugin

Mandrill service plugin for Craft CMS (v2)

This plugin provides the ability to send emails via Mandrill API. It also can control all of the emails send by Craft's EmailService being captured for sending to Mandrill. Read below for more information.

Installation

From the root of your Craft installation, just run composer to install this plugin;

This will install the plugin inside your craft/plugins/ folder automatically.

Composer vendor files

It also brings some other vendor files inside the vendor/ directory in your project root. This can be ignored by your VCS or included when you aren't able to run composer install at your hosting-server.

Maybe your installation is configured to use another path structure. If the plugin can't find the Composer vendor/ folder, it will notify you in the admin panel. To solve it, you can tell us where to find the vendor/ folder. Just add this line to your websites' index.php file, just below the $craftPath definition.

Enable the plugin in Craft

Navigate to Craft's settings > Plugins > Install Mandrill Service plugin.

Configuration settings

API Key

After installation you have to configure the plugin to work at all. Navigate to the plugin settings page and enter the API key you want to use.

Remember: Mandrill provides the ability to have a test-API-key. You can test it as many times you want without having a paid account already. Login to Mandrill and activate a "Test" API key.

Enable as a service

There are two ways of using this plugin. You can use the Mandrill service or let it take over control of sending any email, sent by Craft's EmailService. This is a setting in the plugin;

From settings

The from email and name settings are meant to configure the sender name for your site/application. This can be overwritten when using manual service, but this config settings are used by default.

Craft's general config to override

You can pass the following settings to the general.php configuration file of Craft, to override the settings in the settings page from the plugin.

Take over control of all outgoing emails

Downside (read carefully):

The plugin hooks on the email.onBeforeSendEmail event and disables any further process of Craft's EmailService (by setting $event->performAction = false;). It also will re-fire that event, to be sure all data from any plugin is captured before sending it.

So, why is this a bad thing? Because it can happen (actually: it will!) that your plugin already did it's work before this event reaches the Mandrill-take-over part. But when not, we fire the event again to be sure it will. This will cause a second roundtrip of the email.onBeforeSendEmail event. Depending on what happens on this event, it can slow down the process!

If you're building heavy stuff on this event, it can be good to check if you did your thing already. Like this;

It will not stop coming here twice, but the hard part (or load/performance taking part) of your code will be skipped.

Manually use the service

It's also possible to use the Mandrill service manually.

Using Craft's messages system

Events

The Craft email events are still being used. They contain the same params as the event is getting from Craft's default EmailService.

Additional params are added by the Mandrill service

email.onBeforeSendEmail

email.onSendEmail

email.onSendEmailError

Examples

Find some example usages below

Add-in tags

Your plugin can add tags to email messages easily since the emailMessage is passed by the events given by the Mandrill plugin. Example;

When using service manually;

When the "Mandrill as service" is on;

Using attachments

When using service manually;

When the "Mandrill as service" is on;

Set a schedule date/time

When using service manually;

When the "Mandrill as service" is on;

Outbound view

The plugin comes with a very cool overview where you can see the outbound of Mandrill. It shows you if messages are sent correctly and also gives you an inside when it failes or bounces. All of this can be found in Mandrill too of course.

To enable this feature, you have to add a sync script to your cronjob system. This is the call you have to make (for example 1 to 4 times a day).

You can also use this command to sync it manually.

Note: This command scans Mandrill till 4 days in the past. Since bounces are being tried a couple of times.


All versions of craft-mandrill-service-plugin with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ~1.0
mandrill/mandrill Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bertoost/craft-mandrill-service-plugin contains the following files

Loading the files please wait ....