Download the PHP package nswdpc/silverstripe-mailgun-sync without Composer

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

Silverstripe Mailgun Mailer, Messaging and Webhook handling

This module provides functionality to send emails via the Mailgun API and store events related to messages using Mailgun's webhooks feature

Requirements

See composer.json

Mailgun configuration

You need:

Installing

Configuration

Mailgun account

Configuration of your Mailgun domain and account is beyond the scope of this document but is straightforward.

You should verify your domain to avoid message delivery issues. The best starting point is Verifying a Domain.

MXToolBox.com is a useful tool to check your mailing domain has valid DMARC records.

Module

Add the following to your project's yaml config:

Remember to flush configuration after a configuration change.

See detailed configuration, including project tags

Sending

Mailer

For a good example of this, look at the MailgunSyncTest class. Messages are sent using the default Silverstripe Email API:

To add custom parameters used by Mailgun you call setCustomParameters():

Where $args is an array of your custom parameters. Calling setCustomParameters() multiple times will overwrite previous parameters.

Send the message:

The response will either be a Mailgun message-id OR a Symbiote\QueuedJobs\DataObjects\QueuedJobDescriptor instance if you are sending via the queued job.

Via API connector

You can send directly via the API connector, which handles client setup and the like based on configuration. For a good example of this, look at the MailgunMailer class

The response will either be a Mailgun message-id OR a Symbiote\QueuedJobs\DataObjects\QueuedJobDescriptor instance if you are sending via the queued job.

Direct to Mailgun PHP SDK

If you like, you can send messages and interact with the Mailgun API via the Mailgun PHP SDK:

The response will be a Mailgun\Model\Message\SendResponse instance if successful.

See the Mailgun PHP SDK documentation for examples.

Queued Jobs

The module uses the Queued Jobs module to deliver email at a later time.

This way, a website request that involves delivering an email will not be held up by API issues.

SendJob

This is a queued job that can be used to send emails depending on the config value -

Messages are handed off to this queued job, which is configured to send after one minute. Once delivered, the message parameters are cleared to reduce space used by large messages.

This job is marked as 'broken' immediately upon an API or other general error. Please read the Queued Jobs Health Check documentation to get assistance with Broken job reporting.

TruncateJob

Use this job to clear out older MailgunEvent webhook records. If you don't use webhooks to store events, this job can remain unused.

RequeueJob

Use this job to kick broken SendJob instances, which happen from time-to-time due to API or connectivity issues.

This job will:

  1. Take all job descriptor records for SendJob that are Broken
  2. Reset their status, processing counts and worker value to default initial values
  3. Set them to start after a minute
  4. Save the record

On the next queue run, these jobs will attempt to send again.

Manual Resubmission

Messages can be resent from the Mailgun control panel. This depends on your Message Retention setting for the relevant mailing domain in Mailgun.

DMARC considerations

When sending email it's wise to consider how you maintain the quality of your mailing domain (and IP(s)).

If your mailing domain is "mg.example.com" and you send "From: [email protected]" DMARC rules will most likely kick in at the recipient mail server and your message will be quarantined or rejected (unless example.net designates example.com as a permitted sender). Instead, use a From header of "[email protected]" or "[email protected]" in your messages.

Your Reply-To header can be any valid address.

See dmarc.org for more information on the importance of DMARC, SPF and DKIM

Tests

Unit tests: TestMessage connector.

Sending emails using sandbox/testmode

For acceptance testing, you can use a combination of the Mailgun sandbox domain and API testmode.

Breaking changes in 1.0 release

Version 1 removed unused features to reduce the complexity of this module.

The core functionality is now:

Synchronisation of events is now handled by the webhooks controller

LICENSE

BSD-3-Clause

See LICENSE

Maintainers

Bugtracker

We welcome bug reports, pull requests and feature requests on the Github Issue tracker for this project.

Please review the code of conduct prior to opening a new issue.

Security

If you have found a security issue with this module, please email digital[@]dpc.nsw.gov.au in the first instance, detailing your findings.

Development and contribution

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.

Please review the code of conduct prior to completing a pull request.


All versions of silverstripe-mailgun-sync with dependencies

PHP Build Version
Package Version
Requires symbiote/silverstripe-queuedjobs Version ^4.5
mailgun/mailgun-php Version ^3
kriswallsmith/buzz Version ^1.1
nyholm/psr7 Version ^1.3
silverstripe/framework Version ^4
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 nswdpc/silverstripe-mailgun-sync contains the following files

Loading the files please wait ....