I’m trying to build in a check for out of office replies. I can’t just look for the presence of the words “Out of Office” in the subject as sometimes a user might ask help and say something “Out of Office not working”.
So what I want to do it check the email headers and look for the common headers which might be set.
I tried searching through documentation on how to access the headers and I can’t find anything.
In this thread you mention that the email header can be rendered so I’m trying to do that, but it doesn’t seem to be working. Starting to type {{email.headers doesn’t bring anything up as a helper hint, but it could just be one of those hidden things.
Here are the common email headers that I was able to track down. any of these could be in use, so I’m trying to:
render each of them. If it doesn’t exist, it won’t be rendered
if it is rendered, I’ll have to regex search it for the value which is set and make sure it works.
Right now, I can’t even get it to render… I wouldn’t expect to include the “:” but I did an additional test with it just in case… Just trying to find the right syntax to get some text rendered.
You should be able to access that header in the expression builder and in a field that does text rendering. The syntax is slightly different between the two.
To access the field in the expression builder, hold “SHIFT” on your keyboard while clicking to add a new stanza. This will create a new stanza that is just a text field, and you will need to free-form enter the complete expression:
That was the key that the syntax was different in the expression builder and the render engine.
I like the trick with the shift too! I’ve been toggling over to the JSON, then making the change, and then toggling off again to get the calculated expression in there.
Good news is now that I’ve removed the quotes around the header, I can properly get the value of the various headers. When I incorporate this in the main rule, I’ll post it here again for @KeithTessler and others. Do you have a good way to share rules like this, other than just a copy/paste of the screenshots? That certainly serves the purpose.
Examples of the parsing working for various headers (from a Microsoft Automated reply):
If you want to share it, you could build the expression and then switch to the JSON mode and copy it and paste it here. Someone else could paste your JSON in and they’d have the expression you built.