simexis/elastic-email-web-api

Easily send emails with Elastic Email using Web API PHP Client https://elasticemail.com/

dev-master 2022-04-11 08:53 UTC

This package is auto-updated.

Last update: 2024-10-11 14:44:28 UTC


README

This library allows you to quickly and easily use the Elastic Email Web API v2 via PHP.

Original clone from

Prerequisites

Instalation

composer require simexis/elastic-email-web-api

API

API documentation you can find on Elastic Email website.

Examples

Load account
    $loader = require_once(__DIR__.'/../vendor/autoload.php');

    $configuration = new \ElasticEmailClient\ApiConfiguration([
        'apiUrl' => 'https://api.elasticemail.com/v2/',
        'apiKey' => 'yourApiKey'
    ]);

    $client = new \ElasticEmailClient\ElasticClient($configuration);

    $clientData = $client->Account->Load();
Send email
    $loader = require_once(__DIR__.'/../vendor/autoload.php');

    $configuration = new \ElasticEmailClient\ApiConfiguration([
        'apiUrl' => 'https://api.elasticemail.com/v2/',
        'apiKey' => 'yourApiKey'
    ]);

    $client = new \ElasticEmailClient\ElasticClient($configuration);

    $client->Email->Send(
        "from.example@bar.com",
        "John Doe",
        "sender.example@baz.com",
        "Don John",
        null,
        null,
        "reply.to@foo.com",
        "ReplyTo Name",
        "to@baf.com",
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
        "utf-8"
    );

About

ElasticEmail.WebApiClient is guided and supported by the ElasticEmail Dev Team.

ElasticEmail.WebApiClient is maintained and funded by Elastic Email Inc. The names and logos for ElasticEmail.WebApiClient are trademarks of Elastic Email Inc.

logo