geniv/nette-newsletter

Newsletter form component for Nette Framework

v2.0.3 2018-02-26 22:49 UTC

This package is auto-updated.

Last update: 2024-12-14 04:54:28 UTC


README

Installation

$ composer require geniv/nette-newsletter

or

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

require:

"php": ">=7.0.0",
"nette/nette": ">=2.4.0",
"dibi/dibi": ">=3.0.0",
"geniv/nette-locale": ">=1.0.0",
"geniv/nette-general-form": ">=1.0.0"

Include in application

neon configure:

# newsletter
newsletter:
#    autowired: true
    tablePrefix: %tablePrefix%
#   formContainer: Newsletter\FormContainer
    events:
        - Newsletter\Events\DibiEvent(%tablePrefix%)
        - ClearFormEvent
        - AjaxFlashMessageEvent

neon configure extension:

extensions:
    newsletter: Newsletter\Bridges\Nette\Extension

usage:

protected function createComponentNewsletterForm(NewsletterForm $newsletterForm)
{
    //$mailerLiteForm->setTemplatePath(__DIR__ . '/templates/NewsletterForm.latte');
    $newsletterForm->onSuccess[] = function (array $values) {
        $this->flashMessage('Email has been save!', 'success');
        $this->redirect('this');
    };
    return $newsletterForm;
}

usage:

{control newsletterForm}