Hi Brian,
Thank you for raising this in the community.
I downloaded the fn_outbound_email app version 1.0.9 to take a look at the code and have this info:
The outbound email app uses an app.config value called 'template_file' which is used to specify the location of your Jinja template. On the send email function there is conditional logic so that if a template path is provided and the 'mail_body_text' input is empty the app will open and read the file at the provided path.
There is then another conditional check and if the name of the file is not 'example_send_email.jinja' the value of the input 'mail_body_html' is replaced with the contents of the Jinja template. Finally the template is rendered with the provided incident_data and other function inputs.
There is an 'example_send_email.jinja' file located in the data folder of the integration which shows how the default email message is rendered.
Here is a snippet from the app showing the conditional logic for that app.config value :
if self.template_file_path and not mail_body_text:
with open(self.template_file_path, "r") as definition:
mail_body_html = definition.read()
log.info("Using custom jinja template instead of default, path: %s", self.template_file_path)
if definition.name.find("example_send_email.jinja") == -1:
jinja = False
else:
jinja = True
I will chat with my team to see if we can promote the outbound email code to our public repo.
If this is what you're looking for could you 'Recommend' the answer so others can find this info in future.
Let me know if you have any other questions,
Ryan
------------------------------
Ryan Gordon
Security Software Engineer
IBM
------------------------------
Original Message:
Sent: Wed May 20, 2020 08:41 AM
From: Brian Coleman
Subject: JINJA Templates for Outbound email
I installed the newest version of the outbound email app and finally have it running with no errors. My question is where do the "Jinja Templates" get placed so they are read by the app?
I have the circuit installed on my laptop for Dev purposes and just can't get these templates to be read at all. Any help is greatly appreciated.
Thanks,
Brian
------------------------------
Brian Coleman
------------------------------