Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
5893 Näkymät

in odoo 11 ,There is any way to send mail with  dynamic  body  content  and  'to_adrress' by conditinally.I need to send Mail to diffrent approavls with different content on each stage of my work flow.I need to send emai to users by python code

Avatar
Hylkää
Paras vastaus

Please try like this.

vals = {
'subject': 'Foo',
'body_html': body,
'email_to': 'foo@example.com,bar@example.com',
'email_cc': 'qux@example.com',
'auto_delete': False,
'email_from': 'foobar@example.com',
}

mail_id = self.env['mail.mail'].sudo().create(vals)
mail_id.sudo().send()

Avatar
Hylkää
Paras vastaus

create_values = {
'body_html': "your html body",
'subject': "your subject",
'email_from': your email from,
'recipient_ids': [(4, partner.id)]
}
mail = self.env['mail.mail'].create(create_values)
mail.send()

i used this code to send email without mail template in odoo 12

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
heinäk. 24
14256
1
heinäk. 21
8468
0
huhtik. 20
4969
1
toukok. 18
3237
0
huhtik. 18
3743