Skip to content

mimepost/mimepost-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mimepost-php

MimePost API for sending email. You can find out more about MimePost at https://mimepost.com. For obtaining the value of X-Auth-Token you will need to first signup on MimePost

Latest Version Known Vulnerabilities codecov.io Code Coverage Total Downloads HitCount MIT licensed

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 0.1.0
  • Build package: io.swagger.codegen.languages.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, run the below command:

composer require mimepost/mimepost-php

Then run composer install

include autoload.php:

    require_once('/path/to/mimepost-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api_key
$config = MimePost\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MimePost\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');

$apiInstance = new MimePost\Client\Php\EmailsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

$body = new \MimePost\Client\Model\Email(); // \Swagger\Client\Model\Email | Single Email object
$body->setSubject('This is a subject');
$body->setFromEmail('[email protected]');
$body->setTo(array( array('email' => '[email protected]') )); 
$body->setHtml('<p>This is a test email send using MimePost PHP SDK</p>');

try {
    $result = $apiInstance->sendEmail($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailsApi->sendEmail: ', $e->getMessage(), PHP_EOL;
}

Tests

To run the unit tests:

./vendor/bin/phpunit

FYI: For testing, you can use the api key special-key to test the authorization filters.

Documentation for API Endpoints

All URIs are relative to https://api.mimepost.com/v1/

Class Method HTTP request Description
AccountsApi accountProfileGet GET /account/profile/ Get account profile details
AccountsApi accountProfilePost POST /account/profile/ Update account profile details
AccountsApi settingsGet GET /settings/ Get all the settings
AccountsApi settingsPost POST /settings/ Set a setting
DomainsApi domainsGet GET /domains/ Get a list of all the domains
DomainsApi domainsIdApprovePost POST /domains/{id}/approve/ Submit request for the approval of a verified domain
DomainsApi domainsIdDelete DELETE /domains/{id} Remove a single domain
DomainsApi domainsIdGet GET /domains/{id} Get the details of a single domain
DomainsApi domainsIdVerifyDkimPost POST /domains/{id}/verify_dkim/ Request for the verification of DKIM record for a single domain
DomainsApi domainsIdVerifySpfPost POST /domains/{id}/verify_spf/ Request for the verification of SPF record for a single domain
DomainsApi domainsIdVerifyTrackingPost POST /domains/{id}/verify_tracking/ Request for the verification of tracking record for a single domain
DomainsApi domainsPost POST /domains/ Add single domain
EmailsApi sendEmail POST /emails/ Send email
StatsApi emaillogsGet GET /emaillogs/ Get the logs of a particular date
StatsApi statsGet GET /stats/ Get the summary of stats for a range of dates
WebhooksApi webhooksGet GET /webhooks/ Get the list of all the webhooks
WebhooksApi webhooksIdDelete DELETE /webhooks/{id} Remove a single webhook
WebhooksApi webhooksIdGet GET /webhooks/{id} Get the details of a single webhook
WebhooksApi webhooksIdPut PUT /webhooks/{id} Update the details of a single webhook
WebhooksApi webhooksPost POST /webhooks/ Add single webhook

Documentation For Models

Documentation For Authorization

api_key

  • Type: API key
  • API key parameter name: X-Auth-Token
  • Location: HTTP header

Author

[email protected]