empty body email notifications
When I try to create an email notification template that pulls an IP address, then I trigger the email notification (Not using
notifications test) I get an email with an empty body.
The strange thing is when I use notifications test I can see everything is being filled correctly so the issue shouldn't be a config issue.
I tried using the example notification template and the result is still the same:
I'm testing the notification by triggering a modsec rule.
OS: Ubuntu 24.04
CrowdSec Version: 1.7.212 Replies
Important Information
This post has been marked as resolved. If this is a mistake please press the red button below or type
/unresolve© Created By WhyAydan for CrowdSec ❤️
I'm testing the notification by triggering a modsec rule.Do you mean the modsec scenario, or the appsec rules? becuase appsec doesnt make decisions so the
range .Decisions will be emptythe modsec scenario, I don't use AppSec
I wrote a custom scenario to trigger on the CRS webshell rules specifically, and have a notification set up for that scenario
But are you filtering on a profile that has no decisions?
No decisions, I had issues triggering the notification with both a decision and email notification so I started testing without any decisions.
thats why the email is blank from the template shown as the
range .Decisions has no elements so it will skip and write an empty emailI actually had a few other issues but I want to fix this first
btw does the ordering of decisions and notifications matter, do I need to have the email notification before or after a decision within a profile?
Yes order matters, as it top down so if it matches the first and continue to the second the decision will only be applied after
so that means I need to place the email notification above the decisions block?
well it depends on what information you want.
if you want to send an email with meta information then you just need to alter the template.
if you want to send an email with decision information then either your profile needs a decision or you have to change the default "on_sucess: break" to continue but then it gets really messy
I just tested it and it's working fine now even with the decisions. weird
issue is definitely fixed, I'll open another ticket on other problems I found.
Resolving empty body email notifications
This has now been resolved. If you think this is a mistake please run
/unresolve