Download the PHP package lekoala/silverstripe-mailgun without Composer

On this page you can find all versions of the php package lekoala/silverstripe-mailgun. 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 silverstripe-mailgun

SilverStripe Mailgun module

Build Status Scrutinizer Code Quality Code Coverage Build Status codecov.io

Latest Stable Version Total Downloads License Monthly Downloads Daily Downloads

codecov.io

Setup

Define in your .env file the following variables

MAILGUN_API_KEY='YOUR_API_KEY_HERE'
MAILGUN_DOMAIN='example.com'

or by defining the api key in your config.yml

This module uses the official client Also make sure to check the official documentation

You can also autoconfigure the module with the following environment variables

# Will log emails in the temp folders
MAILGUN_ENABLE_LOGGING=true
# Will disable sending (useful in development)
MAILGUN_SENDING_DISABLED=true

By defining the Api Key, the module will register a new transport that will be used to send all emails.

If you're using the Mailgun EU service you can change the API endpoint

# Will use https://api.eu.mailgun.net/v3
MAILGUN_ENDPOINT='https://api.eu.mailgun.net/v3'

Debug

Create a postbin http://bin.mailgun.net/ and set the following parameters

MAILGUN_ENDPOINT='http://bin.mailgun.net/XXX'
MAILGUN_DEBUG=true

Please note that the test suite does not work with postbin because it returns html response and do not mock api behaviour

Register the new mailer

If you define the MAILGUN_API_KEY variable, the mailer transport will be automatically registered.

Otherwise, you need to call the following line:

Mailgun integration

This module create a new admin section that allows you to:

NOTE : Make sure that you have a valid api key (not a subaccount key) to access features related to installation of the webhook through the CMS.

Setting tags or metadata

By using custom headers you can pass parameters to the api by following the same principle than the SMTP api.

The main way to pass parameters is to add a json encoded string through the X-Mailgun-Variables header, but you can also use that Mandrill compatiblity layer.

Webhooks

NOT IMPLEMENTED YET

From the Mailgun Admin, you can setup a webhook for your website. This webhook will be called and MailgunController will take care of handling all events for you. It is registered under the __mailgun/ route.

By default, MailgunController will do nothing. Feel free to add your own extensions to MailgunController to define your own rules, like "Send an email to the admin when a receive a spam complaint".

MailgunController provides the following extension point for all events:

And the following extensions points depending on the type of the event:

You can also inspect the whole payload and the batch id with

You can test if your extension is working properly by visiting /__mailgun/test if your site is in dev mode. It will load sample data from the API.

Please ensure that the url for the webhook is properly configured if required by using the following configuration

You can also define the following environment variable to log all incoming payload into a given directory. Make sure the directory exists. It is relative to your base folder.

MAILGUN_WEBHOOK_LOG_DIR='_incoming'

Preventing spam

Inlining styles

In order to have the best resulst, we use the package pelago\emogrifier to inline styles

If you want to restore default functionnality, use this

Todo

Compatibility

Tested with 4.4 but should work fine on any 4.x

Maintainer

LeKoala - [email protected]


All versions of silverstripe-mailgun with dependencies

PHP Build Version
Package Version
Requires php Version >=8
silverstripe/framework Version ^4.0
symbiote/silverstripe-gridfieldextensions Version ^3.2
pelago/emogrifier Version ^6.0
mailgun/mailgun-php Version ^3.0
kriswallsmith/buzz Version ^1.0
nyholm/psr7 Version ^1.2
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 lekoala/silverstripe-mailgun contains the following files

Loading the files please wait ....