In order to send a customized mail to the library members with overdue books, you will need to do the following:
- Find a member with a late document, and click on the Send message link in the chatter:
- Use the expand arrows in the top-right corner of the textbox to get the expanded composition interface.
- Type in the skeleton of the message as follows, and change the subject:
- Click on the Save as new template button. This will create a new template and link it into the Use template field.
- You can then click on the link to open and edit the new template:
- In that screen, replace Fabien with ${object.name}.
- Then, click on the Code View button (third button from the right in the preceding screenshot, displayed as </>).
- In the code view screen, locate the <ul> opening tag, which is the one in the bullet list of the late books and insert a line break before it and another line break after it (refer to step 12 for a screen capture).
- On the line before the opening li tag, insert the following text:
% for row in object.loan_ids:
- Inside the tag, replace the text Odoo Development Cookbook with ${row.book_id.name} (due on ${row.expected_return_date}.
- After the closing of the li tag, insert a line break and add the following line:
% endfor
- This is how it should look like:
- In the email configuration page, set the To (Emails) field to ${object.email}.
- Click on the Save button. You will get back to the email composition window, and the text will have been updated to use the expected return date of the document.
- You can click on Send to send the email.
- Next time you want to remind a member about late documents, you can select the mail template in the Use template field of the mail composition window.