I wrote below code for sending email when ever student batch is created
def on_update(self):
self.send_mail()
def send_mail(self):
sub = "hello"
content = "Please be informed that you have been added to student batch details for student batch are following {batch_name}".format(batch_name=self.student_batch_name)
for student in self.students:
email = frappe.db.get_value("Student",{"name":student.student},"student_email_id")
try:
send(recipients=email,sender="shahidkhan0211@gmail.com",subject=sub,message=content,reference_doctype = self.doctype, reference_name = self.name,
send_priority = 0)
except frappe.OutgoingEmailError:
print frappe.get_traceback()
pass
```
when i add student to student batch
mail is not sending after seven minute
but when click send mail button one of the mail is sending
can any one help me please<img src="/uploads/default/original/2X/0/0e40341194cf5fffd884cc9ff5e38f80a289e634.png" width="690" height="212">
when i click button on top right corner this happens and mail successfully sends
<img src="/uploads/default/original/2X/0/05e2c6bf87b9ef2733d351d7298ef94dcb94fbf1.png" width="690" height="387">
please help me with this