-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Description
Hi, nice library!
Is it possible to import a template from an external file (for example template.html)? I've adapted the example code in the docs, but am getting a TypeError - see below.
If this is possible, I'm happy to send a pull request to extend the docs examples.
sendemail.py
import emails
from emails.template import JinjaTemplate as T
message = emails.html(
subject=T('Payment Receipt No.{{ billno }}'),
html=T(open('template.html')),
mail_from=('ABC', 'robot@mycompany.com')
)
r = message.send(...)
This gives:
$ python sendemail.py
Traceback (most recent call last):
...
TypeError: Can't compile non template nodes
Metadata
Metadata
Assignees
Labels
No labels