Skip to Content
Menú
This question has been flagged
1 Respondre
4390 Vistes

Hello All,

I've created my own email template and email sever both are created.

Now how can i send an email to customer from python method?

I've follow some example of v8 api which are not working for me.

Any example which can help me to achieve this feature on v9

I tried but getting this error?

self.ensure_one()
 raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: mail.template()

Thank you.

Prince.    

Avatar
Descartar
Best Answer

Hello Prince,

Try to use this code.

template=self.env.ref('External_ID_of_email_template')

template.send_mail(self.id,force_send=True)


Hope this helps.

Avatar
Descartar
Related Posts Respostes Vistes Activitat
0
de febr. 18
3078
3
de des. 24
5362
1
de set. 16
3589
0
d’oct. 15
3775
0
de jul. 24
1151