mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-26 06:46:08 +03:00
.. | ||
Exceptions | ||
README.md | ||
Routes.php |
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.