1. Go to this page and download the library: Download remp/mailer-module library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
remp / mailer-module example snippets
$configurator = new Nette\Configurator;
$configurator->addConfig(__DIR__ . '/../vendor/remp/mailer-module/src/config/config.root.neon');
// ... rest of the configuration
class UrlParserGenerator implements IGenerator
{
// ...
public function generateForm(Form $form)
{
// ...
$form->addTextArea('articles', 'Article')
->setAttribute('rows', 7)
->setOption('description', 'Paste article URLs. Each on separate line.')
->getControlPrototype()
->setAttribute('class', 'form-control html-editor');
// ...
}
class NewsfilterGenerator implements IGenerator
{
// ...
public function getWidgets()
{
return [NewsfilterWidget::class];
}
}
class UrlParserGenerator implements IGenerator
{
// ...
public function apiParams()
{
return [
new InputParam(InputParam::TYPE_POST, 'source_template_id', InputParam::REQUIRED),
new InputParam(InputParam::TYPE_POST, 'articles', InputParam::REQUIRED),
new InputParam(InputParam::TYPE_POST, 'footer', InputParam::REQUIRED),
new InputParam(InputParam::TYPE_POST, 'rtm_campaign', InputParam::REQUIRED),
new InputParam(InputParam::TYPE_POST, 'intro', InputParam::REQUIRED)
];
}
}
class NewsfilterGenerator implements IGenerator
{
// ...
public function preprocessParameters($data)
{
$output = new \stdClass();
if (!isset($data->post_authors[0]->display_name)) {
throw new PreprocessException("WP json object does not contain $output->editor = $author->display_name;
$output->from = $author->display_name . ' <' . $author->user_email . '>';
break;
}
if (!isset($data->post_title)) {
throw new PreprocessException("WP json object does not contain not contain
return "my-provider";
return [
[
'name' => String, // user friendly label
'provider' => String, // should be same as result of provider()
'code' => String, // machine friendly name, slug
'group' => [
'id' => Integer, // ID of segment group
'name' => String, // user friendly label of group
'sorting' => Integer // sorting index; lower the number, sooner the group appears in the list
]
],
];
return [
$userId => [
'id' => String, // userId
'email' => String, // valid email address of user
// you can provide optional data that can be used within your email templates, for example:
'first_name' => String,
'last_name' => String,
],
];