Skip to content
  1. Extras
  2. Sendex

Sendex snippet

Component for email newsletters.

The snippet is simple: users can subscribe and unsubscribe.

If the user is logged in, one click is enough. If not, they must confirm their email.

If a logged-in user is already subscribed, an unsubscribe button is shown. Anonymous users can unsubscribe via the link in the email.

Parameters

NameDescription
&idNewsletter ID.
&showInactiveShow or hide inactive newsletters.
&msgClassCSS class output in [[+class]] when [[+message]] is not empty. Use to hide the message block until needed.
&tplActivateChunk for the subscription activation email.
&tplSubscribeAuthChunk for the subscribe form (logged-in users).
&tplSubscribeGuestChunk for the subscribe form (guests).
&tplUnsubscribeChunk for the unsubscribe form.

Calling the snippet

Call the snippet uncached, because output depends on whether the user is logged in. Create a newsletter first. See the Interface section.

modx
[[!Sendex? &id=`1`]]

All user messages are output in [[+message]] in the form chunks.

History

The component was written as a demo for paid courses on bezumkin.ru. Course materials are here.

Source code on GitHub.

Sendex is currently being tested and stabilized.