-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set a local/custom template in Email actions #126
Comments
Try creating a custom action and include the path for your template inside |
When trying to load a template that is an absolute path, Jinja2 loader didn't look at the right place, but instead it concatenates the provided absolute path to the paths loaded in the At this moment you can not use absolute paths for Spidermon's custom templates. You need to create a custom action inherited from SendMail and define the a template_paths list as class attribute, containing the absolute location of your desired template. After that include just the name of your template. |
Considering that my template is located in
and add to
|
@matiskay Spidermon 1.10.2 allows you to set an absolute path for your custom templates. |
Hi,
I would like to know if there is way to pass a local jinja template to the actions. I'm setting a local path and absolute path in
SPIDERMON_BODY_HTML_TEMPLATE
but I'm getting aTemplateNotFound
error.I tried
SPIDERMON_BODY_HTML_TEMPLATE = 'reports/email/monitors/result.jinja'
and it worked but I would like to add my own template.It looks like jinja2 loader only looks at
/spidermon/contrib/actions/reports/templates/
folder insidespidermon
package.The text was updated successfully, but these errors were encountered: