Skip to content

mailmojo/mailmojo-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MailMojo SDK for PHP

v1 of the Mailmojo API

This package is automatically generated by the Swagger Codegen project:

  • API version: 1.1.0
  • Package version: 0.7.0

For more information, please visit https://mailmojo.dev

Requirements

PHP 5.5.0 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "require": {
    "mailmojo/mailmojo-php-sdk": "0.7.0"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/mailmojo/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure. The following is an automatically generated example executing one operation, just to illustrate how the library is used in general:

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

// Configure OAuth2 access token for authorization: mailmojo_auth
MailMojo\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new MailMojo\Api\WebhookApi();
$id = 56; // int | ID of the webhook.

try {
    $api_instance->deleteWebhook($id);
} catch (Exception $e) {
    echo 'Exception when calling WebhookApi->deleteWebhook: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://api.mailmojo.no

Class Method HTTP request Description
AccountApi createAccount POST /v1/accounts/ Create an account.
AccountApi createAccountField POST /v1/accounts/fields/ Create a custom field on the account.
AccountApi deleteAccountField DELETE /v1/accounts/fields/{field_id}/ Delete a custom field on the account.
AccountApi getAccountByUsername GET /v1/accounts/{username}/ Retrieve account details.
AccountApi getAccountFields GET /v1/accounts/fields/ Returns info about all available fields on the account.
AccountApi getAccountIntegrations GET /v1/accounts/integrations/ Retrieve installed integrations for an account.
AccountApi updateAccount POST /v1/accounts/{username}/ Update account details.
AccountApi updateAccountField PATCH /v1/accounts/fields/{field_id}/ Update a custom field on the account.
AccountApi updateAccountIntegration PATCH /v1/accounts/integrations/{integration_id}/ Update installed integration settings.
AutomationApi getAutomationById GET /v1/automations/{automation_id}/ Retrieve an automation by id.
AutomationApi updateAutomation PATCH /v1/automations/{automation_id}/ Update a draft or paused automation partially.
ContactApi getContactByEmail GET /v1/contacts/{email}/ Retrieve a contact in any list by email.
ContactApi getContacts GET /v1/contacts/ Retrieve all contacts across every list.
ContactApi getHistoricalContactStats GET /v1/contacts/stats/ Retrieve historical stats over contacts across every list.
ContactApi getSubscriberOnListByEmail GET /v1/lists/{list_id}/subscribers/{email}/ Retrieve a subscriber.
ContactApi getSubscribersOnList GET /v1/lists/{list_id}/subscribers/ Retrieve subscribers on a list.
ContactApi getUnsubscribedOnList GET /v1/lists/{list_id}/unsubscribed/ Retrieve unsubscribed contacts on a list.
ContactApi subscribeContactToList POST /v1/lists/{list_id}/subscribers/ Subscribe a contact to the email list.
ContactApi unsubscribeContactOnListByEmail DELETE /v1/lists/{list_id}/subscribers/{email}/ Unsubscribe a contact.
ContactApi updateContact PATCH /v1/contacts/{email}/ Update details about a contact.
EmbedApi createEmbedSession POST /v1/embed/ Create a new embedded application session.
FormApi formAddSubscriber PATCH /v1/forms/{id}/subscribers/ Add a subscriber through a form and track the conversion.
FormApi getFormById GET /v1/forms/{id}/ Retrieve a form.
FormApi getForms GET /v1/forms/ Retrieve all forms.
FormApi trackFormView PATCH /v1/forms/{id}/track/view/ Track a view of a form.
FormApi updateForm PATCH /v1/forms/{id}/ Update a form partially.
ListApi createList POST /v1/lists/ Create an email list.
ListApi createSegment POST /v1/lists/{list_id}/segments/ Create a segment in the email list.
ListApi getListById GET /v1/lists/{list_id}/ Retrieve an email list.
ListApi getLists GET /v1/lists/ Retrieve all email lists.
ListApi getSubscriberOnListByEmail GET /v1/lists/{list_id}/subscribers/{email}/ Retrieve a subscriber.
ListApi getSubscribersOnList GET /v1/lists/{list_id}/subscribers/ Retrieve subscribers on a list.
ListApi getUnsubscribedOnList GET /v1/lists/{list_id}/unsubscribed/ Retrieve unsubscribed contacts on a list.
ListApi importSubscribersToList POST /v1/lists/{list_id}/subscribers/import/ Subscribe contacts to the email list.
ListApi subscribeContactToList POST /v1/lists/{list_id}/subscribers/ Subscribe a contact to the email list.
ListApi unsubscribeContactOnListByEmail DELETE /v1/lists/{list_id}/subscribers/{email}/ Unsubscribe a contact.
ListApi updateList PATCH /v1/lists/{list_id}/ Update an email list partially.
NewsletterApi cancelNewsletter PUT /v1/newsletters/{newsletter_id}/cancel/ Cancel a newsletter.
NewsletterApi createNewsletter POST /v1/newsletters/ Create a newsletter draft.
NewsletterApi getNewsletterById GET /v1/newsletters/{newsletter_id}/ Retrieve a newsletter by id.
NewsletterApi getNewsletters GET /v1/newsletters/ Retrieve all newsletters.
NewsletterApi sendNewsletter PUT /v1/newsletters/{newsletter_id}/send/ Send a newsletter.
NewsletterApi testNewsletter POST /v1/newsletters/{newsletter_id}/send_test/ Send a test newsletter.
NewsletterApi updateNewsletter PATCH /v1/newsletters/{newsletter_id}/ Update a newsletter draft partially.
PageApi getPageById GET /v1/pages/{id}/ Retrieve a landing page.
PageApi getPages GET /v1/pages/ Retrieve all landing pages.
PageApi trackPageView PATCH /v1/pages/{id}/track/view/ Track a view of a landing page.
PageApi updatePage PATCH /v1/pages/{id}/ Update a landing page partially.
SegmentApi createSegment POST /v1/lists/{list_id}/segments/ Create a segment in the email list.
TemplateApi getAvailableWebComponents GET /v1/templates/web_components/ Retrieve all web components.
TemplateApi getTemplates GET /v1/templates/ Retrieve all templates.
WebhookApi createWebhook POST /v1/webhooks/ Create a webhook.
WebhookApi deleteWebhook DELETE /v1/webhooks/{id}/ Delete a webhook.

Documentation For Models

Documentation For Authorization

mailmojo_auth

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://api.mailmojo.no/oauth/authorize/
  • Scopes:
    • account: Manage your Mailmojo account.
    • account_creation: Create new Mailmojo accounts.
    • account_creation.trial_30: Create new Mailmojo accounts with a 30 day trial period.
    • account_settings: Manage your Mailmojo account settings.
    • automations: Manage your automations.
    • automations:read: Retrieve your automations.
    • contacts: Manage your contacts across all your email lists.
    • contacts:read: Retrieve your contacts across all your email lists.
    • embed: Give you an embedded Mailmojo application with access to your account.
    • events: Track events on your forms and landing pages.
    • forms: Manage your forms.
    • forms:read: Retrieve your forms.
    • lists: Manage your email lists, excluding subscribers.
    • lists:read: Retrieve your email lists, excluding subscribers.
    • newsletters: Manage your newsletters.
    • newsletters:read: Retrieve your newsletters.
    • pages: Manage your landing pages.
    • pages:read: Retrieve your landing pages.
    • subscribe: Add subscribers to email lists.
    • templates: Manage your templates.
    • templates:read: Retrieve your templates
    • webhooks: Manage your webhooks.

Author

hei@mailmojo.no

About

PHP SDK for the Mailmojo API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •