industrious-mouse/laravel-dotmailer
Laravel wrapper for the dotmailer-api-v2-client library (https://github.com/romanpitak/dotmailer-api-v2-client)
3,364
6
| Install | |
|---|---|
composer require industrious-mouse/laravel-dotmailer |
|
| Latest Version: | 0.2.1 |
| PHP: | >=5.3.0 |
| License: | MIT |
| Last Updated: | Oct 31, 2018 |
| Links: | GitHub · Packagist |
Maintainer: industrious-mouse
Laravel Dotmailer
A very basic Laravel wrapper for the Dotmailer API Client by romanpitak.
Installation
To install, inside your project directory run the following from your terminal:
composer require industrious-mouse/laravel-dotmailer
Then load the service provider in your config/app.php:
IndustriousMouse\LaravelDotmailer\LaravelDotmailerServiceProvider::class
You'll also need to publish the config, so you can provide your keys:
php artisan vendor:publish --provider="IndustriousMouse\LaravelDotmailer\LaravelDotmailerServiceProvider"
Examples
Adding a Contact with custom data fields.
$contact_data = new ApiContact([
'email' => 'test@test.com',
'emailType' => 'Html',
'dataFields' => [
[
'key' => 'FIRSTNAME',
'value' => 'Name'
]
]
]);
try
{
$contact = Dotmailer::PostContacts($contact_data);
}
catch (Exception $e)
{
return $e;
}
Sending a Campaign to a contact
$contact_id = 12345;
$campaign_id = 12345;
$data = [
'CampaignId' => $campaign_id,
'ContactIds' => [
$contact_id
]
];
$send = Dotmailer::PostCampaignsSend(new ApiCampaignSend($data));
try
{
$contact = Dotmailer::PostContacts($contact_data);
}
catch (Exception $e)
{
return $e;
}
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
641,106,524
9,700
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
418,291,778
609
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
394,964,158
4,660
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 0.2.1 | >=5.3.0 | MIT | ||
| 0.2 | >=5.3.0 | MIT | ||
| 0.1 | >=5.4.0 | 4.2.* |