How Can We Help?

Post to Telegram rules

You are here:
< All Topics

Post to Telegram module of WP Telegram Pro supports rules to decide how or when a post should or should not be sent to Telegram. The rules section not only supports the usual post data like post category, tag, author, post type etc., rather it now supports custom field based rules. Not only that, you can now use different operators to create advanced rules, based on post category, tag, author, post type, custom fields, ACF fields, WooCommerce fields etc.

Lets dive in:

Basic rules

The basic rules are these, where you can select when and which post types should be sent using a Post to Telegram instance.

Those basic rules are not enough in most of the cases. So, you can see the + Add button there to add your own rules.

You can select the rule types based on different post related data. The rules are added in groups. The instance with those rules will be used if and only if the post satisfies at least one rule group. Rule group is considered applicable only if all of the rules in that group are satisfied. Simply, groups are joined by logical OR, while as rules inside a group are joined by logical AND.

Advanced/Custom rules

Not happy with that limited set of rules? No worries. There are also the custom rules that you can add.

advanced post to telegram rules

When you choose that, you will see the field to enter your own macro/tag to create a rule

advanced post to telegram rules

In that field, you can use anything from Message Template macros/tags. For example, if you have a custom field named 'location', you can use {cf:location} in that field. Likewise, you can use WooCommerce fields like {wc:price}, {wc:weight}, {wc:save_amount}, {wc:save_percent} etc.

In Comparison Value field, you need to enter the value that the field value should be compared to.

Operators

Advanced rules can have these operators:

advanced post to telegram rules
  • is equal to
    This operator compares the value of the given field from post data to the comparison value given for equality. It should be used to compare singular values like custom fields, ACF fields and WooCommerce fields.
    Example: {cf:venue_location} is equal to London
  • is not equal to
    This operator compares the value of the given field from post data to the comparison value given for inequality. It just does the opposite of the equality operator.
    Example: {cf:current_status} is not equal to pending
  • is empty and is not empty
    These two operator check if the value of the given field from post data is empty. You do not need to supply the Comparison value for these two operators.
    Example: {wc:sale_price} is empty or {wc:sale_price} is not empty
  • is greater than
    This operator checks if the value from the post data is greater than the comparison value.
    Example: {wc:price} is greater than 1000
  • is greater than or equal to
    This operator checks if the value from the post data is greater than or equal to the comparison value. It works same as is greater than operator, except that it includes the boundary values in comparison.
  • is less than
    This operator checks if the value from the post data is less than the comparison value.
    Example: {wc:price} is less than 1000
  • is less than or equal to
    This operator checks if the value from the post data is less than or equal to the comparison value. It works same as is less than operator, except that it includes the boundary values in comparison.
  • contains and does not contain
    These operators check if the value from the post data contains the comparison value.
    Examples:
    {post_title} contains NEW
    {wc:short_description} does not contain Refurbished
  • is in and is not in
    These operators check if the field value from post data is in the comma separated list given in the comparison value.
    Example:
    1. {acf:zipcode} is in 12345678, 987654321, 0147852369
  • is between and is not between
    These two operators check if the field value from post data is BETWEEN the comma separated two numbers given in the comparison value. This operator should only be used for comparing numbers.
    Example:
    1. {wc:price} is between 500,1500
    i.e. if the product price is between 500 and 1500.
  • starts with and does not start with
    This operator checks if the field value from post data starts with the value given in comparison value field.
    Example:
    {post_title} starts with Breaking
    i.e. if the post title starts with “Breaking” (for example “Breaking News”).
  • ends with and does not end with
    This operator checks if the field value from post data ends with the value given in comparison value field.
    Example:
    {post_title} ends with Latest

IMPORTANT NOTES:

  • When using {post_author} in custom rules, you should use username for comparison
  • When using taxonomies like {tags}, {categories} or {terms:produc_cat} etc. in custom rules, you should use term slug.
Table of Contents

Ready to dive in? Buy NOW