Notify Snippet Tutorial

I could tell you how many hours it takes to develop a MODX extra Transport Package complete with a build script, properties, multiple MODX elements, internationalized strings, error checks, and then fully test it, but you wouldn't believe me. If you use this extra and like it, please consider donating. The suggested donation for this extra is $20.00, but any amount you want to give is fine (really). For a one-time donation of $50.00 you can use all of my non-commercial extras with a clear conscience.


PayPal

Overview

Notify will let you send an email notification to Subscribers on your site (or to all active users) when a page is created or updated (or just when you feel like sending them a message). Rather than sending the whole page, Notify sends a message with a link to the new or updated page. Optionally, you can specify tags for the message and only subscribers with those tags set will receive the email. Notify works in conjunction with the Subscribe extra, which lets users register at your site and manage their preferences (tags).

(Jump to Properties Table.)

Notify will also send Tweets to Twitter and (optionally) post the Tweets to your Facebook page. There is an option to shorten any URLs present in any of the Notify Tpl chunks using any of a variety of URL shortening services (TinyUrl, Google, StumbleUpon, bit.ly, is.gd, and to.ly at present).

 

What's New

New in this version:

  • Add support for Mailgun
  • Refactor to allow easier addition of new mail services
  • Create MailService interface
  • Improve diagnostics
  • Add mailService property
  • Add additionalHeaders property
  • Use Composer for Mandrill and Mailgun classes
  • Implement optimized autoloader

New in Previous Versions

  • Allows launch from NewsPublisher and other extras (see below)
  • Fixes bugs with Tpl names
  • Looks for chunks prefixed with 'My'
  • Fixes undefined variable bug in JS
  • Fixes bug with oauth
  • Sends email (optionally) with the Mandrill email service (see below for more info).
  • Has Buttons to select User Groups to send to.
  • Shows a progress bar for bulk sends
  • Sends mail in batches to save memory (batch size is adjustable).
  • Has much more efficient database queries for quicker sends.
  • Sends email to a single user by email or username
  • Allows user tags for any field of the user profile (including the 'extended' fields).
  • Processes chunk, snippet, and setting tags in the email Tpl chunk.
  • Allows resource and TV placeholder tags!
  • Makes inserting the unsubscribe link optional.

 

Upgrade Notes

With the death of free Mandrill, Notify has been refactored to allow the use of Mailgun. See the Mailgun section below. Mandrill will still work, but as of April 27, 2016, will cost about $30/month to use.

Notify Version 1.4.0 introduces a new property: &mailService for selecting the mail service to use. The choices are modMailX (the MODX phpMailer implementation), MandrillX, and MailgunX. The modMailX implementation is much slower than the others since it requires that every message be sent separately. The &useMandrill property will still work, but is deprecated.

 

Installing Notify for MODX Revolution

Go to System | Package Management on the main menu in the MODX Manager and click on the "Download Extras" button. That will take you to the Revolution Repository. Put Notify in the search box and press Enter. Download Notify, then click on the button that takes you back to Package Management. Click on the "Install" button next to Notify in the grid. The Notify package should now be installed.

During the installation, the Notify TV will be connected to the site's default template. If you need to attach it to other templates, you'll have to connect it manually by editing the TV, checking the boxes on the "Template Access" tab, and clicking on the "Save" button.

If you want Notify to post to Twitter and/or Facebook, you'll need to set the four Twitter properties (see below).

 

Using Notify

Notify uses a front-end form to send notifications to subscribers, and Messages to Twitter and/or Facebook. When you click on the "Launch Notify" button of the Notify TV when editing a resource, (having set the desired radio-button option) you are forwarded to the Notify resource, where the Notify snippet pre-fills and displays the Notify form. Note that sending updates with Notify is always strictly manual. No updates to subscribers, twitter, or facebook are ever sent automatically. For some people, receiving an update every time you save a page can get pretty annoying, so Notify only sends updates when you tell it to by submitting the form with one of the update options checked.

To launch the Notify form:

  1. Go to the Create/Edit Resource form for a document
  2. Click on the "Template Variables" tab
  3. Select the Notify area, if necessary
  4. Select the type of update you want from the radio options
  5. Click on the "Launch Notify" button

That will launch the notify Form (see below for launching Notify from NewsPublisher or another snippet or plugin).

The Notify snippet pre-fills the Notify form. The values for the email, email subject, and Tweet come from the Notify Tpl chunks. The four radio buttons below the "Launch Notify" button set which chunks are used for the Email text and Tweet text. For both email and Twitter, there is a Tpl chunk for notifying users of new resources and one for announcing updates to existing resources. The two custom Tpls (one for the email and one for Twitter) can be used for anything you want. Finally, there is a blank option which will display the form with the Email text and Tweet text fields empty. If you want to change any of the default Tpl chunks, be sure to duplicate them (adding the prefix "My"). Notify will look first for the Tpl chunks prefixed with 'My', then in the Tpl chunks specified in the snippet properties or in a property set.

You can change the text in any of the fields before submitting the form. If you change the text of the email, click on the "Submit" button without checking any of the checkboxes to see a preview of the email in the Preview window. You can't, however, add MODX tags to the message. All MODX tags are processed as the Tpl chunk is retrieved, so by the time you're entering the message, it's too late. You can add user field placeholders, however, in this form {{+fieldName}}. The username and all fields of the User Profile will be set as user placeholders. If you use the &useExtendedFields property, any extended fields will be set as well.

When sending updates, Notify acts when you submit the form, but only when you have set at least one of the checkboxes. To send an update, just check the appropriate checkboxes, then submit the form. You can alter any field on the form, but if you do, don't use any MODX placeholders. Placeholders are only replaced when the form is first rendered. Also, any URLs you enter will not be shortened. Again, that only happens when the form is first rendered. You can, however, use user placeholders in the form {{+fieldName}}, which will be processed when the email is sent.

The various options are independent, so you can send a single email, send a message to subscribers, or send a Tweet without activating the other options. When you click on the "Single Email" checkbox, an input field will appear where you can enter either the email address or the user name of a user on the site.

Notify pre-fills the email subject, email message, and Tweet fields for you, but you can put whatever you want into them. If you just want to email your subscribers to tell them what you had for breakfast, you can do that. The only page-specific information will be the URL (filled in by Notify) and any Resource Content tags that you include in the Tpl chunk (e.g. pagetitle, introtext, description , etc.). You're free to add, or delete any of them. In other words, you can use Notify to send any email message to your subscribers, optionally selected by Group(s) and/or Tag(s). Just remember that MODX placeholders are not available to you if you do this, though user placeholders are.

[[$CreateSnippetPropertySet? &snippetName=`Notify`]]

Call your Property Set "NotifyProperties". Notify already specifies that Property Set in the Notify snippet tag for you. If you use that name, Notify will also make sure to reconnect the Property Set to the snippet when you upgrade. If you use another name for the Property Set, you'll have to remember to reconnect it to the snippet when you upgrade or your updates to Twitter, Facebook, and/or the URL shortening service may stop working.

 

Placeholders

You can personalize the message sent to each user by using placeholders. All user-specific placeholders, including the unsubscribe_url, now take this form: {{+username}}, {{+email}}, {{+unsubscribe_url}}. Snippet, chunk, and setting tags are standard MODX tags — these should be used only for information that will be the same for all users. All Resource Fields and any specified TVs are now available with MODX placeholder tags:

[[+pagetitle]]
[[+TvName]]

 

Tpl Chunks

Important: If you are using the default Tpl chunks, duplicate them and add the prefix 'My' to each one before installing any Notify upgrade. Notify will look first for those prefixed chunks. If it doesn't find them, it will look for the ones specified in the Tpl-related properties. The chunks prefixed with 'My' will not be altered during future upgrades, so you can use them without having to specify them in the snippet properties or in a property set. In other words, you no longer need to specify your own customized Tpl chunks in the properties. Just prefix them with 'My'. Notify will use them automatically and they will survive upgrades.

 

Groups

As of Version 1.2.0, User Groups can be entered in the form with buttons like the tags. Notify uses the chunk specified in the &groupListChunkName property as the source of the group buttons. That property defaults to the sbsGroupListTpl chunk in the Subscribe category. The chunk should be formatted as follows:

DisplayedGroupName==ActualGroupName||DisplayedOtherGroupName==ActualOtherGroupName

Email is only sent to active users. The &groups property can contain a comma-separated list (no spaces) of User Groups to send to. You can also add them to the form by clicking on the buttons below the input. The buttons come from the content of a Tpl Chunk specified in the &groupListChunkName property. It defaults to the SbsGroupListTpl chunk (see the format for the tags Tpl chunk in the next section). By default, Notify sends to members of the "Subscribers" User group, but you can change that by setting the &groups property of the snippet. Whatever is set will appear in the Notify form, but you can change it there. If you leave the Groups field in the Notify form blank when submitting the form, the email message will be sent to all active users on your site.

 

Tags


If you are using the Subscribe snippet (recommended), you can ignore most of this section and just set the Notify &prefListChunkName property to point to the preference list Tpl used by Subscribe. Notify will use the same tags and will handle them automatically.

The &tags property is blank by default, so the email is sent to all members of User Groups specified in the &groups property. If you enter tags in the Tags field, only users who have those tags (interests) will receive the email.

You can fill in the user interests for each user as a comma-separated list (no spaces) in the "Comment" field of the User Profile (or optionally in an extended field of the User Profile), but the Subscribe package will do that for you and it will also let users manage their own interest lists. See the Subscribe package documentation for more information on how the tags are stored.

If you are using the Subscribe package, Notify will use the sbsPrefList Tpl chunk from that package (or another chunk you specify in the Notify &prefListChunkName property) to put tag buttons under the tags input field. Clicking on one of the buttons will toggle that tag in the "Tags" input field.

If you're not using the Subscribe package and you'd rather use an extended field of the User Profile instead of the comment field, you can create two new System Settings:

sbs_use_comment_field   (set the value to 'No')
sbs_extended_field   (name of the extended field you want to use)

You'll have to create the extended field for each user unless the Subscribe extra has done it for you. You'll also have to create a chunk to hold the list of user preferences (tags) and set the &prefListChunkName property to point to it. By default, the chunk used will be sbsPrefListTpl, which is the default chunk used for tags in the Subscribe extra. If you have created a new preference list chunk for Subscribe, be sure to set the Notify &prefListChunkName property to point to it.

The format for the Preferences List Tpl chunk is a series of Caption==value pairs separated by || symbols.

Example:

Caption One==Option1||Caption Two==option2||Caption Three==option3

The "caption" (to the left of the == signs) is what is shown in the Subscribe extra Register and Manage Preferences forms. The "value" (to the right of the == signs) is what will be stored in the database. It is also used for the tag buttons in the Notify form and is what you should use in the Notify "Tags" input field. Make sure that there are no spaces except in between the words of the caption and that the preferences list is all on one line in the Tpl chunk.

In the Notify form, clicking on a tag button will add or delete that tag from the "Tags" field of the form. The tag buttons shown are based on the tags in the chunk specified in the Notify &prefListChunk property.

 

Require All Tags

By default, a user will receive an email if he or she has a tag that matches *any* of the tags selected in the form. As of Notify Version 1.1.1, you can add a checkbox to the form that will let you select only users who have *all* the selected tags. You might have a 'developers' tag and a 'modx' tag, for example. With the checkbox unchecked, if you select those two tags in the form, users with either tag will get the email. With "Require All Tags" checked, however, only users with both tags will get the email. Because Notify responds to the checkbox, this option is settable on a per-email basis.

 

I haven't actually tested this, but I think if the "Require All Tags" checkbox is checked and you don't select any tags, no users will be selected. That combination doesn't make much sense anyway.

 

If you don't need this feature, you shouldn't need to do anything. If you do want it, and are using a customized Tpl chunk for the form (rather than the default one), you need to know that the form Tpl has changed. Just insert the following code in your NotifyFormTpl chunk.

<label for="nf_require_all_tags">
    <input type="checkbox" id="nf_require_all_tags" name="nf_require_all_tags" [[+nf_require_checked]]/> [[%nf.require_all_tags? &namespace=`notify` &topic=`form`]]
</label>

The code can go anywhere in the form, but just below the section containing the tag buttons is a good location.

The "Require All Tags" checkbox is unchecked by default. If you would like to change that, add &requireAllTagsDefault=`1` to the Notify snippet tag or set that property to 'Yes' in the Property Set.

 

Mailgun

The MailgunX class is included in Version 1.4.0 of Notify. In order to use Mailgun, you need to go to Mailgun and create an account. Mailgun requires you to set DKIM and SPF records and verify the domain. The method for this varies depending on the domain registrar. Follow the directions at Mailgun. If you would like to track opens and clicks, you'll also need to set a CNAME record. This is a bit of a hassle, but on the plus side, it will increase the deliverability of your emails by quite a bit and prevent them from ending up in the spam folder.

Get a Mailgun API key through your Mailgun dashboard and set it in the Mailgun properties of the Notify snippet. You may also wish to get a Mailgun sandbox domain to use during testing and set that in the Notify properties as well. Note that when using the sandbox domain, Messages will still be sent to users. You can set the &testModx property = `1` to prevent the messages from being sent.

Don't forget to set the &mailService property to MailgunX.

 

Mandrill

Mandrill is an email service and a subsidiary of MailChimp. As of April 27, 2016, Mandrill is no longer free. As of Version 1.4.0 or Notify, the MandrillX class is included in the package. There is no longer any need to install it separately. If you want to use Mandrill with Notify, you need to create a Mandrill account, get a Mandrill API Key, create a subaccount called test at Mandrill, set the mandrill_api_key System Setting, and the &useMandrill snippet property. All of that should take about 10-20 minutes and is described in more detail below.

Using Mandrill with Notify is easy. Go to Mandrill and open a free account. Hover over the little gear icon at the upper right and select "SMTP & API Credentials.". Click on the blue "New API Key" button. Copy the API key code and paste it either into the input when you install MandrillX, or any time later, into the mandrill_api_key System Setting in the Manager (find it with the search box at the upper right in System -> System Settings).

Before you leave Mandrillapp.com, hover over "Outbound" on the top menu and select "Subaccounts" in the dropdown menu. Click on the blue "Create a Subaccount" button. Call your subaccount test (all lowercase). This is the default subaccount used by Notify when you install it. It assumes that you don't want all your test emails in a real subaccount. Once you are up and running, you can create a new subaccount, add &subaccount=`NewSubName` to the Notify snippet tag or its property set, and (optionally) delete the "test" subacccount at Mandrill.

One last thing is necessary for using Mandrill — you have to tell Notify to use Mandrill by adding &nfUseMandrill=`1` to the snippet tag or setting that property to Yes in the property set.

Remember that if you change any of the Notify Snippet's default properties, they will be reset to their defaults when you upgrade Notify.

That's it. Once you've complete those steps, Notify will use Mandrill automatically for all its emails.

 

The additionalHeaders property

Notify 1.4.0 add this property to allow you to add custom headers to your emails. Do *not* use this for standard email fields and headers: to, from, reply-to, etc., this property is for custom headers of your own. The property takes a JSON-formatted string in the following form:

`{"X-header1":"someValue","X-header2":"someOtherValue"}`

You can use the &additionalHeaders property for Cc and Bcc headers, but it's not recommended. Using those fields assumes that the message will be exactly the same for each user, and with some mail services, Bcc headers are not hidden as they should be. Instead, just add the users that should get copies of the message to the User Group that will get the messages.

 

Launching Notify from NewsPublisher

Recent versions of NewsPublisher will launch Notify after successfully saving a new or updated resource. If the &shownotify property in the NewsPublisher tag is set to 1, you'll see a checkbox for launching Notify at the bottom of the NewsPublisher form. It will contain radio options for selecting the Tpl chunk used by Notify. If the notifychecked property is set to 1, the checkbox will be checked by default. For security, in order to run Notify, the current user needs view_user permission in the 'web' context and must be a member of the Administrator user group (the role doesn't matter).

If you'd like to launch Notify from your own code in a plugin or snippet, the process is very simple. Here's some sample code:

$id = 12; /* Set to the ID of the page with the Notify tag */
$pageId = 22; /* Set to the ID of the page being created or updated */
$pageType = 'new';  /* or 'existing', 'custom', or 'blank' */
$url = $modx->makeUrl($id, "", "", "full");
$_SESSION['pageId'] = $pageId;
$_SESSION['pageType'] = $pageType;
$modx->sendRedirect($url);

 

Notify and Articles

To the best of my ability to test it, Notify works fine with Articles. You need to attach the Notify TV to whatever template you use for your Articles posts, otherwise it works as expected. Notify will use the URL shortener specified in the Notify properties rather than the one used by Articles. The only other thing to remember is that the tags used by Articles and Notify are independent. Notify will ignore the Articles tags and Articles will ignore the Notify tags. This is intentional because the Notify tags match up with the limited list of Subscriber interests and the Articles tags are to help users find Articles.

 

Email Log

For each email update, Notify writes a log file to the core/components/notify/notify-logs directory. The file is named for the resource and date and time of the update. The log shows the message sent, the users and their tags, and if possible any problems in sending the email to each user. The &maxLogs property determines how many logs are kept. When the limit is reached, Notify will delete the oldest log. The default is 5, but you can set it to any number or 0 for unlimited logs.

When using Mandrill or Mailgun, only a minimal local log is kept since those services provide a much better log with some sophisticated analytics. The local log will have the date and time, resource pagetitle, and the mail service in the filename, and only the message itself as the log content.

 

Setting the Notify Properties

Notify has many properties, but for most of them, the default values will work fine. You'll need to set the Twitter properties to send Tweets. Depending on the URL shortening service you use, you may also have to set the URL shortener properties if you want short URLs. If you want to change the Tpl chunks, you'll want to duplicate them and use a Property Set as described above to set the properties that tell Notify their names so your changes won't be overwritten when Notify is upgraded. If you use a Property Set, don't forget to specify it in the Notify snippet tag on the Notify page like this:

[[!Notify@NotifyProperties]]

The tag above is already set in the install, so if you name your property set "NotifyProperties" it will be used automatically.

 

Notify Template and CSS

If you need to modify the Notify Template, duplicate it and change the Template of the Notify page to your new Template. The Notify form CSS file is assets/components/notify/css/notify.css. If you would like to modify it, create a new file and change the reference in the Notify Template (after duplicating the Template and resetting the Template of the Notify page).

 

Posting Updates to Twitter

In order for Notify to post updates to Twitter, you'll need to create a Twitter App at the Twitter Dev site (if you don't have one already). Log in to Twitter before following the link.

Follow the instructions at that URL for creating a new application. Once you have it all set up, you can go to the the URL above and select the "My Applications" breadcrumb at the top left. Then, click on your Twitter username and select the "OAuth Tool" tab. you should see the four keys you need to set the Notify properties.

See the section above on creating a Property Set if you haven't done so already. To set the properties, edit the Notify snippet and click on the "Properties" tab. Then select your Property Set by clicking on the word "Default" just above the grid on the right. Double-click on a value to change it, and when you're done, click on the "Save Property Set" button (*not* the "Save" button). Don't forget to specify the Property Set in the Notify snippet tag as described above.

Once you've cleared the cache, you can post an update to Twitter from the Template Variable tab of the Create/Edit Resource panel in the Manager. Notify will pre-fill the Tweet TV for you, but you can edit it to contain whatever you like. Notify will enforce the 140-character limit on the length of the tweet.

 

Posting Updates to Facebook

Notify does not post directly to Facebook, but you can set up an account at Selective Tweets in about 30 seconds. Once you've done that, simply add the hashtag #fb to any Tweet and the Tweet will be posted to your Facebook page in addition to Twitter. If you set the ¬ifyFacebook property of the Notify snippet, the #fb hashtag will be added automatically to the end of the Tweet and you'll see it in the Notify form. You can remove it manually if you don't want the Tweet to go to Facebook.

You can also use a Twitter App if you want to post *all* your Tweets to Facebook, but I don't recommend doing that if you're a heavy Twitter user because it will load up your Facebook page with lots of Tweets that most visitors won't want to see.

 

How Notify is Launched

There's no reason you need to know, but you might be curious about how the Notify form is launched from the TV tab of the Create/Edit Resource panel. The method is quite exotic. The Caption of the Notify TV is actually a <button> tag:

    <button id="nf-b" onClick="nf()"> Launch Notify </button>

When the button is clicked, it launches the nf() JavaScript Function. The JavaScript source code is in the Notify plugin, which is connected to the OnDocFormPrerender event. When the Manager form is rendered, that plugin gets information about the current resource, replaces the placeholders in the JS code with the appropriate values, and injects the JS into the section of the Manager form page.

The JS code adds the color to the button and adds the form below the button with hidden input fields containing the page info. When the button is clicked, the JS code checks to make sure the Resource has been saved (popping up a warning if it hasn't), and if it has, submits the form to the Notify page where the information is read from the $_POST array. It's difficult to imagine doing this in any other CMS but MODX without touching a line of the core code.

 

Troubleshooting

If you create a Property Set and it is not taking effect, double check the name of the Property Set and the name used in the Notify snippet tag. They must match. Make sure the Property Set is connected to the snippet. You should be able to see the Property Set when you click on the Default drop-down on the Properties tab of the Snippet. If it's not there, click on the "Add Property Set" button and select the Property Set. Then click on the "Save" button at the upper right (not the "Save Property Set" button).

If you upgrade Notify and your Property Set is no long shown in Tools | Property Sets, it may mean that the Property Set has an obsolete category. The only solution is to use PhpMyAdmin to edit the modx_property_sets table and change the category of the Property Set to 0.

If you follow the Unsubscribe/Manage Preferences link in a test email using the same browser you used to send the emails, you'll have to log out or Flush All Sessions before doing anything else in the Manager. This is because following the link resets $modx->user, which changes the MODX session in that browser.

If you are testing on a localhost install, some URL shortening services (bit.ly for one) will fail to produce a valid URL. This is normal — they just don't consider "localhost" a valid domain.

If no emails are being sent using the modMailX service, install the QuickEmail package to help diagnose your problem sending emails.

 

Adding a New MailService

As of Notify 1.4.0, it's much easier to add support for a new mail service such as Sendgrid, Mailgrid, or CampaignMonitor, for use with Notify. You can create a new class that extends an existing third-party API wrapper class (usually obtained from the mail service's web site) and your class will plug in to Notify.

Include the third-party wrapper class at the top of your class file. Your class should implement the Notify MailService interface found in the mailservice.php file in the Notify model directory. Include that file also at the top of your class file. Add an X to the name of the parent class for your class name, and a .class.php suffix to the class file. Declare your class like this example that implements a hypothetical SendGrid service :

Class SendGridX extends SendGrid implements MailService {}

For your class, start with the MailgunX class file contents and modify it to match what the SendGrid, or other mailservice, expects. Then add the service name (e.g., SendGridX) to the &mailService property of the Notify snippet. You may not need all the methods of the MailService interface, but they all must be present, though the body of unused methods can be empty. You may also want to add your class and the wrapper class to the autoload_classmap.php file in the Notify vendor/composer directory.

This is not a trivial job, but it's much easier than it was before the creation of the MailService interface.

It's also possible to bypass the API wrapper class and write your own base class to interact with the mail service API or add the necessary methods to your own class, but it's usually much easier to use an existing API wrapper as your base class.

 

Notify Properties

Property Description Default
additionalHeaders (optional) JSON string specifying custom headers (do not use for regular mailfields: cc, bcc, to, from, reply-to). Example: `{"X-header1":"someValue","X-header2":"someOtherValue"}`.
allowedGroups (optional) Comma-separated list of groups that are allowed to use Notify Administrator
batchDelay (optional) Delay between batches in seconds 1
batchSize (optional) Batch size for bulk email to subscribers 25
bitlyApiKey bit.ly API key (required)
bitlyUsername bit.ly username (required)
debug Set to Yes to output debugging information
googleApiKey Google API key
groupListChunkName Specifies the chunk that will be used for the buttons under the Groups input in the form sbsGroupListTpl
groups Comma-separated list of User Groups to send to (no spaces). The Subscribers group will be set in the form, but if you delete it and submit with the Groups field empty, email will be sent to all users on the site Subscribers
includeTVList Comma-separated list of TV names. Only TVs on the list will have their placeholders set
includeTVs If set, placeholders will be set for Resource TVs No
itemDelay (optional) Delay between individual emails in seconds .51
mailFrom (optional) MAIL_FROM setting for email emailsender System Setting
mailFromName (optional) MAIL_FROM_NAME setting for email site_name System Setting
mailReplyTo (optional) REPLY_TO setting for email emailsender System Setting
mailSender (optional) EMAIL_SENDER setting for email emailsender System Setting
mailService Which mail service to use: modMailX (MODX mail system), MailgunX, MandrillX modMailX
maxLogs Set this to limit the number of email logs kept. The oldest one will be deleted. Set to 0 for unlimited logs 5
nfEmailTplCustom Name of chunk to use for custom Notify email Tpl NfSubscriberEmailTplCustom
nfEmailTplExisting Name of chunk to use for updated resource Notify email NfSubscriberEmailTplExisting
nfEmailTplNew Name of chunk to use for the new resource Notify email NfSubscriberEmailTplNew
nfFormTpl Name of chunk to use for the Notify form NfNotifyFormTpl
nfSubjectTpl Name of chunk to use for the Email subject NfEmailSubjectTpl
nfTestEmailAddress (optional) Email address for test email emailsender System Setting
nfTweetTplCustom Name of chunk to use for the custom Tweet text nfTweetTplCustom
nfTweetTplExisting Name of chunk to use for the updated resource Tweet text nfTweetTplExisting
nfTweetTplNew Name of chunk to use for the new resource Tweet text nfTweetTplNew
nfUnsubscribeTpl Name of chunk to use for Unsubscribe link NfUnsubscribeTpl
nfUseMandrill Use Mandrill service to send email
notifyFacebook Notify Facebook via Twitter with #fb in tweet -- must be set up in the Facebook Selective Tweets App
prefListChunkName (optional) Chunk to use for preferences (tags) list sbsPrefListTpl
processTVs If set to No, the raw values of the TVs will used 1
profileAlias (optional) class of the user profile object. Only necessary if you have subclassed the user profile object Profile
profileClass (optional) class of the user profile object. Only necessary if you have subclassed the user profile object modUserProfile
requireAllTagsDefault (optional) sets the default value of the Require All Tags checkbox; if set, only users who have all tags will receive email No
sortBy (optional) Field to sort by when selecting users username
sortByAlias (optional) class of the user object. Only necessary if you have subclassed the user object modUser
subaccount Name of the Mandrill subaccount to send through if using Mandrill. Subaccount must exist or send will fail test
suprApiKey StumbleUpon API key (optional)
suprUsername Stumble Upon Username (optional)
tags (optional) Comma-separated list of tags (no spaces). If set, only users in specified Groups with the interest(s) set will receive the email
testMode Test mode -- Notify functions normally, but no emails are sent. 1
tinyurlApiKey TinyUrl API key (optional)
tinyurlUsername TinyUrl username (optional)
twitterConsumerKey Twitter Consumer Key
twitterConsumerSecret Twitter Consumer Secret
twitterOauthSecret Twitter Access Token Secret
twitterOauthToken Twitter Access Token
urlShorteningService Service used to shorten all URLs in text and Tweet none
useExtendedFields If set, placeholders will be set from the extended fields of the User Profile No
userClass (optional) class of the user object. Only necessary if you have subclassed the user object modUser
injectUnsubscribeUrl If set, adds an unsubscribe/manage preferences link to every email Yes
nfTestEmailAddress Default username or email to send single email to.

 

My book, MODX: The Official Guide - Digital Edition is now available here. The paper version of the book is available from Amazon.

If you have the book and would like to download the code, you can find it here.

If you have the book and would like to see the updates and corrections page, you can find it here.

MODX: The Official Guide is 772 pages long and goes far beyond this web site in explaining beginning and advanced MODX techniques. It includes detailed information on:

  • Installing MODX
  • How MODX Works
  • Working with MODX resources and Elements
  • Using Git with MODX
  • Using common MODX add-on components like SPForm, Login, getResources, and FormIt
  • MODX security Permissions
  • Customizing the MODX Manager
  • Using Form Customization
  • Creating Transport Packages
  • MODX and xPDO object methods
  • MODX System Events
  • Using PHP with MODX

Go here for more information about the book.

Thank you for visiting BobsGuides.com

  —  Bob Ray