How to assign a email template for TODO doctype when Reference Type is a particular doctype

I made a custom doctype in which users are assigned for each doctype record, and a mail is being sent to the users when they are assigned now i want to set a email template which should be sent to the assigned users rather than default email template

With code possible, without code not possible (you have to select the email template manually).

Reference (with code): Utility Functions

hey @ncp,
so i should add custom code for the todo doctype right?
how can i add custom code for a built-in doctype?

You need to implement a logic where an email is triggered whenever a ToDo document is saved. For this, you have to create a server script. I have already provided the documentation for reference.

Here is another useful reference for setting up the server script to use frappe.sendmail:

Email Queue, Email CC, and Recipients Discussion