From 6e3052970ae126e723abe28b7d25ae1eba1ffe2c Mon Sep 17 00:00:00 2001 From: Joshua van Besouw Date: Mon, 8 Jul 2024 13:02:39 +0200 Subject: [PATCH] Update usage.md Updated docs to include notification expression guide link. --- content/extensions/notifications/usage.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content/extensions/notifications/usage.md b/content/extensions/notifications/usage.md index b116950..1ac7f08 100644 --- a/content/extensions/notifications/usage.md +++ b/content/extensions/notifications/usage.md @@ -31,7 +31,7 @@ The extension uses a mostly complete version of the Django Template Engine which You can do some fairly advanced templating using the built in conditions, functions, template tags and filters. For further details on builtin template tags and filters take a look at this [section](https://docs.djangoproject.com/en/1.11/ref/templates/builtins/). ### Additional Template Tags @@ -114,12 +114,17 @@ The same applies to the total amount of a transaction. When fees exist in relate When working with webhook events, it is often necessary to only send notifications when certain conditions are met. The notification extension has an expression system that allows administrators to define a condition on when a notification should be sent. These expressions are evaluated against the webhook event data and must evaluate to either `True` or `False`. A faulty expression always evaluates to `False` but an empty expression always evaluates to `True`. + Expressions use a combination of two parsing methods. They occur in the following order: 1. Django Template Engine is used to replace tags in the expression string with content. 2. A safe python evaluator is then run on the resulting string. The Rehive dashboard contains notification templates with expression presets that you can take a look at if you need examples. + + A small list of basic examples can be found below: **Credit transaction (transaction.execute)**: