geniv/nette-mailerlite

MailerLite newsletter component for Nette Framework

v2.0.4 2018-02-25 11:10 UTC

This package is auto-updated.

Last update: 2020-10-13 19:51:58 UTC


README

www: https://www.mailerlite.com/

API: https://app.mailerlite.com/integrations/api/

Composer API: https://github.com/mailerlite/mailerlite-api-v2-php-sdk

Installation

$ composer require geniv/nette-mailerlite

or

"geniv/nette-mailerlite": ">=1.0.0"

require:

"php": ">=7.0.0",
"mailerlite/mailerlite-api-v2-php-sdk": ">=0.2.1",
"geniv/nette-general-form": ">=1.0.0"

neon configure:

# mailer lite
mailerLite:
#   autowired: true
    api: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy
#   formContainer: MailerLite\FormContainer

neon configure extension:

extensions:
    mailerLite: MailerLite\Bridges\Nette\Extension

usage:

protected function createComponentMailerLiteForm(MailerLiteForm $mailerLiteForm)
{
    //$mailerLiteForm->setTemplatePath(__DIR__ . '/templates/MailerLiteForm.latte');
    $mailerLiteForm->onSuccess[] = function (array $values) {
        $this->flashMessage('Email has been save!', 'success');
        $this->redirect('this');
    };
    $mailerLiteForm->onError[] = function ($error) {
        $this->flashMessage('Error! ' . $error->message, 'danger');
        $this->redirect('this');
    };
    return $mailerLite;
}

usage:

0000000 is id mailerlite group

{control mailerLiteForm '0000000'}