Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
4354 Prikazi

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
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
feb. 18
3048
3
dec. 24
5352
1
sep. 16
3577
0
okt. 15
3760
0
jul. 24
1144