2017 © Pedro Peláez
 

library smartemailing

SmartEmailing wrapper for Nette Framework.

image

lzaplata/smartemailing

SmartEmailing wrapper for Nette Framework.

  • Tuesday, February 13, 2018
  • by Zap
  • Repository
  • 1 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 8 % Grown

The README.md

SmartEmailing

This is small Nette Framework wrapper for SmartEmailing., (*1)

Installation

The easiest way to install library is via Composer., (*2)

$ composer require lzaplata/smartemailing: dev-master

or edit composer.json in your project, (*3)

"require": {
        "lzaplata/smartemailing": "dev-master"
}

You have to register the library as extension in config.neon file., (*4)

extensions:
        smartEmailing: LZaplata\SmartEmailing\DI\Extension

Now you can set parameters..., (*5)

smartEmailing:
        username           : *
        apiKey             : *

...and autowire library to presenter, (*6)

use LZaplata\SmartEmailing\Client;

/** @var Client @inject */
public $smartEmailingClient;

Usage

Import contact

try {
    $this->smartEmailingClient->importContact($email, $contactlistId);
} catch (\Exception $e) {
    echo $e->getMessage();
}

Get single email

try {
    $request = $this->smartEmailingClient->getEmail($id);

    echo $request->json();
} catch (\Exception $e) {
    echo $e->getMessage();
}

Send custom email

First of all you have to declare LZaplata\SmartEmailing\Helpers\Email object and then pass it as parameter to sendCustomEmail function., (*7)

try {
    $email = new Email();
    $email->setSender($senderEmail, $senderName);
    $email->setRecipient($recipientEmail, $recipientName);
    $email->setSubject($subject);
    $email->setHtmlBody($html);
    $email->setTag($tag);
    $email->setReplacements([
        "key" => "content"
    ]);

    $this->smartEmailingClient->sendCustomEmail($email);
} catch (\Exception $e) {
    echo($e->getMessage());
}

The Versions

13/02 2018

dev-master

9999999-dev https://github.com/LZaplata/SmartEmailing

SmartEmailing wrapper for Nette Framework.

  Sources   Download

New BSD

The Requires

 

by Lukáš Záplata

nette smartemailing