wellcometrust / dotmailer-php
PHP Client library for the Dotmailer REST (v2) API
Installs: 21 250
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 15
Forks: 6
Open Issues: 3
Requires
- php: ^7.1.3
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpmd/phpmd: ^2.6
- phpunit/phpunit: ^7.1
- squizlabs/php_codesniffer: ^3.2
This package is not auto-updated.
Last update: 2024-11-06 09:40:18 UTC
README
PHP client library for the Dotmailer REST API (v2) described at https://developer.dotmailer.com/docs/
Installation
composer require wellcometrust/dotmailer-php
Usage
<?php
use Dotmailer\Adapter\GuzzleAdapter;
use Dotmailer\Dotmailer;
require 'vendor/autoload.php';
$adapter = GuzzleAdapter::fromCredentials('apiuser-XYZ@apiconnector.com', 'PASSWORD');
$dotmailer = new Dotmailer($adapter);
$addressBooks = $dotmailer->getAddressBooks();
print_r($addressBooks);
If you are using Symfony, you may choose to configure the service as follows, and then use throughout your application:
# app/config/services.yml
Dotmailer\Adapter:
factory: ['Dotmailer\Adapter\GuzzleAdapter', fromCredentials]
arguments: ['%dotmailer_username%', '%dotmailer_password%', '%dotmailer_uri%']
Dotmailer\Dotmailer:
arguments: ['@Dotmailer\Adapter']
Coverage
Currently the following endpoints are covered:
- Address books
- Get address books
- Campaigns
- Get all campaigns
- Get campaign
- Contacts
- Create contact
- Delete contact
- Update contact
- Add contact to address book
- Delete contact from address book
- Get contact by email
- Get contact address books
- Get unsubscribed contacts since date
- Unsubscribe contact
- Resubscribe contact
- Contact data fields
- Create contact data field
- Delete contact data field
- Programs
- Get programs
- Create program enrolment
- Transactional email
- Send transactional email
- Send transactional email using a triggered campaign