.. _conditional_templates: ##################### Conditional templates ##################### .. highlight:: smarty 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 :ref:`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! .. image:: _static/options_conditions.jpg :height: 266px :width: 777px :scale: 100% :alt: Conditions To be able to use conditional templates you have to **activate it** for subject and / or body in the options. See :ref:`option_conditions_for_subject` and :ref:`option_conditions_for_body`. Conditional templates have two main language constructs: - {{ }}: used to print the result of an expression evaluation; - {% %}: used to execute statements. .. toctree:: :maxdepth: 2 template_filters template_custom_filters template_conditions template_loops template_functions