Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
4401 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
0
févr. 18
3081
3
déc. 24
5373
1
sept. 16
3600
0
oct. 15
3777
0
juil. 24
1151