Sending emails using the QWeb template
In the previous recipe, we learned how to send emails using the Jinja template. In this recipe, we will see another way to send dynamic emails. We will send emails with the help of the QWeb template.
Getting ready
For this recipe, we will use the my_library
module from the previous recipe, Sending emails using the Jinja template. We will use the QWeb template to send an email to the borrower informing them that their book is overdue.
How to do it...
Follow these steps to send a reminder email to the borrower:
- Add the QWeb template into the
my_library/data/mail_template .xml
file:<template id="book_return_reminder_qweb">     <p>Dear <span t-field="object.borrower_id.name"/>,</p>     <p>You had rented the         <b>             <...