You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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', '[email protected]')
)
r = message.send(...)
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 aTypeError
- see below.If this is possible, I'm happy to send a pull request to extend the docs examples.
sendemail.py
This gives:
The text was updated successfully, but these errors were encountered: