Conditional templates

With Post Status Notifier you can create conditional email texts. This means you are able to place dynamic content, depending on the value of placeholders (see all available Placeholders).

Post Status Notifier uses the power of the famous Twig template engine for PHP to realize conditions, loops and filters in notification texts. This is way you can use the default functionality of Twig.

Additionally Post Status Notifier provides special filters and functions to optimze the usage with WordPress. You can access WordPress internal functions with {{ wp.[function_name] }}, for example {{ wp.get_post(8).post_title }} which will display the post title of the post with ID 8. This gives you a great flexibility in creating custom, dynamic notification texts.

Note

You have to activate this feature in the options!

Conditions

To be able to use conditional templates you have to activate it for subject and / or body in the options. See Enable for subject and Enable for body.

Conditional templates have two main language constructs:

  • {{ }}: used to print the result of an expression evaluation;

  • {% %}: used to execute statements.