mailgun-php/src/Mailgun/Routes
2013-08-02 17:59:20 -07:00
..
Exceptions Addition of campaigns, logs, lists, and routes 2013-08-02 10:48:57 -07:00
README.md Adjusted API key for samples 2013-08-02 17:59:20 -07:00
Routes.php Fixed an issue with HTTPBroker, Lists, Routes and Stats 2013-08-02 16:32:22 -07:00

Mailgun - Routes

This is the Mailgun PHP Routes endpoint.

The below assumes you've already installed the Mailgun PHP SDK in to your project. If not, go back to the master README for instructions.

Usage

Here's how to use the "Routes" API endpoint:

# First, instantiate the client with your PUBLIC API credentials and domain. 
$mgClient = new MailgunClient("key-3ax6xnjp29jd6fds4gc373sgvjxteol0", "samples.mailgun.org");

# Next, instantiate a Routes object on the Routes API endpoint.
$routes = $mgClient->Routes();

# Next, add the new route.
$routes->addRoute(0, "Match defined recipient", "match_recipient(\"^chris\+(.*)@example.com$\")", "forward(\"mbx@externaldomain.com\")");

Available Functions

getRoutes(int $limit, int $skip)

getRoute(string $routeId)

addRoute(int $priority, string $description, string $expression, string $action)

updateRoute(string $routeId, int $priority, string $description, string $expression, string $action)

deleteRoute(string $routeId)

More Documentation

See the official Mailgun Docs for more information.