Quick start

Vestnik1 min readPage 2 of 12
On this page 4

Step 1. Template

On the “Templates” tab click “New template”. MODX tags work in the subject and body: [[+username]], [[+email]], conditions via filters [[+order_id:notempty=`...`]]. The “Test send” button sends the email to any address right away (bypassing the queue) to check the layout. The sender can be set in the template, otherwise it comes from the settings.

Step 2. Rule

On the “Rules” tab click “New rule”: event key, template and recipient strategy. For several recipients of one event, create several rules with the same key.

Step 3. Cron

Add the script to the scheduler, for example every minute:

* * * * * php /path/to/site/core/components/vestnik/cron.php >> /path/vestnik-cron.log 2>&1

Step 4. Event

Fire an event in one of the ways — the plugin for standard MODX events, the snippet or code (see “Event sources”). For example:

[[!vestnik_notify? &event=`order.paid` &email=`[[+email]]` &data=`{"order_id":"105","fullname":"John"}`]]

And set the administrator address in vestnik_admin_email if you use the “Administrator” strategy.