Download the PHP package arckinteractive/mailgun without Composer

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

Mailgun Client for Elgg

Elgg 2.0

Mailgun is a transactional Email API Service for developers by Rackspace. It offers a complete cloud-based email service for sending, receiving and tracking email sent through your websites and applications.

Visit http://www.mailgun.com/ for more information about Mailgun and to register for a free account.

Features

Configuration

Outbound

Visit https://mailgun.com/signup to signup for a free Mailgun account if you do not already have one. The first thing you need to do in your Mailgun account is to create and verify a domain. Refer to the Mailgun documentation for that step.

The settings required for sending email are the simplest. You just need your API key and domain.

Plugin Settings

A sample email template is included in views/default/mailgun/notification/body.php and should be modified for your site by overriding the view. You can view that the template will look like by clicking the View Email Template button. Additionally, clicking the Send Test Email button will send an email to the currently logged in user.

Site Email Address

The site email address needs to match your configured domain. In your basic site settings you would use for example [email protected].

Site Email Address

Inbound

Handling inbound emails requires configuring either a store or forward route. If you are a developer working locally where your system cannot be connected to from the public Internet you would configure a route to store your messages for later retrieval. Alternately for a production site you would configure a route to forward messages directly to the site.

Mailgun routes can be configured directly through the plugin settings. Read up on Mailgun routes before continuing.

Forward Route

Assuming our configured domain is em.domain.com and we wants all emails sent to [email protected] to be forwarded to our site we would add a route like:

Priority:    0
Expression:  match_recipient('^notifications\+.*@em.domain.com')
Action:      forward('http://www.domain.com/mg/messages')
Description: Production notification replies

In the recipient address everything after the + symbol is the unique token (or string) that is used by plugins to identify the message. When the message is received by the mailgun plugin it triggers an event. Other plugins that have registered for the event will check the token and if it is theirs they will process the email and return false to halt further event propagation.

Store Route

Using the same domain name as the forward route example (em.domain.com) lets assume you are a developer and need to be able to test inbound email handling but your local development environment can not receive webhooks (posts) from the public Internet. Your route might look like this:

Priority:    0
Expression:  match_recipient('^testing\+.*@em.domain.com')
Action:      store() | stop()
Description: Production notification replies

In this example any emails matching [email protected] will be stored on the Mailgun servers. With free accounts Mailgun will hold stored messages for 2 days.

When adding actions to routes multiple actions can be chained together. Use the | symbol to delimit multiple actions. In this example the stop() action stops processing of any lower priority routes.

Next, configure your stored messages to be retrieved. This requires enabling polling and configure a 1 minute cron.

Message Polling Settings

Notice that we need to specify a recipient here. This is a simple string match and is required because you could potentially have multiple store routes configured. When the poller runs we want it to only retrieve messages stored for this testing / developer site. That's it! Now every 60 seconds the poller will fetch any emails sent to your testing email address.

Developer Notes

The Mailgun plugin provides the settings and functionality to fetch or receive inbound emails however how those emails are handled is up to other plugins. For instance your forum could allow users to reply to notifications by adding a unique token to the outbound emails and registering to receive inbound emails from mailgun.

I created an additional plugin that can be used as a further example called mailgun_messages. The mailgun messages plugin enhances the core messages plugin to allow email replies to site messages.

The following code samples show how to add a unique token to your outbound emails and to register for and receive email from the mailgun plugin.

Tokens

A mailgun token will be automically added to subscription notifications about objects, users and groups (e.g. when a new blog post is published).

You can customize the token added to subscription notifications, using the "prepare","notification:<action>:<entity_type>:<entity_subtype>" hook:

A mailgun token will be automatically added to instant notifications that have been assigned an object, e.g.

A mailgun token can be added to instant notification via params, e.g.

You can also pass your token as $params['token'] to elgg_send_email().

For automatically generated tokens, you can use mailgun_get_entity_by_notification_token() to map the token back to an entity.

Custom instant notifications

In this example we have a forum plugin that notifies subscribed members when a new topic is posted.

Receiving Replies

By default, the plugin will attempt to match an incoming email to a notification event and store it as a comment (or reply for discussion topics) on a notification event object. This will apply to core create, update and publish events for registered object types.

If an incoming email is matched to a personal message, it will sent to the recipient via the messages plugin.

Now to handle all the deep and meaningful replies to the forum topic we can use something like this:

Written with StackEdit.


All versions of mailgun with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ^1.0.8
pelago/emogrifier Version ~1.0
composer-plugin-api Version ^1.0
mailgun/mailgun-php Version ^2.1
fire015/flintstone Version ^2.0
ramsey/uuid Version ^3.4
php-http/guzzle6-adapter 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 arckinteractive/mailgun contains the following files

Loading the files please wait ....