Write a Client Script to Automatically Send Email Using Email Templates After Document Creation

Could you please provide guidance on how to write a client script that sends an email using email templates after a new document is inserted in the doctype?

@Prathyusha ,
I think you can use Notification Doctype. This doctype will handle to send notification for new documents.

i want to send emails to the user based on status field value,based on the its value email template is changed thats why i am trying to use Email Template doctype.

@Prathyusha write more than one notification and write a condition on each one depending on the status

@Prathyusha

There is also an option for that. “Send Alert On” and Value Changed.
Try to utilize that. and add multiple documents for status

yeah
the notification method is the best possible way
if you need another way you can write code in hooks.it is also possible way to do this task

I am trying Notifications also but not getting mails.But not working.

My doctor where i am trying to apply this feature

@Prathyusha Try to check in email Queue.

Create an Email Template in your system, including placeholders for dynamic data.
Write a Server Script to trigger the after_insert event, fetch the email template, format the message, and send the email using the system’s email service.