Sending emails using the Jinja template
Odoo supports creating dynamic emails through Jinja templates. Jinja is a text-based templating engine used to generate dynamic HTML content. In this recipe, we will create a Jinja email template and then send emails with its help.
Getting ready
For this recipe, we will be using the my_hostel
module from the previous recipe, Managing activities on documents. We will add the Jinja template to send an email to the student to tell them about the admission to the hostel.
How to do it...
Follow these steps to send a reminder email to the student:
- Create a new file called
my_hostel/data/mail_template.xml
and add the email template:<?xml version="1.0" encoding="utf-8"?> <odoo noupdate="1"> Â Â Â <record id="assign_room_to_student" model="mail.template"> Â Â Â Â Â Â Â <field name="name">Assign Room To Student...