跳至内容
菜单
此问题已终结
1 回复
1745 查看

hi im trying to create a send email button but when i click it it doesnt send it immediately i check email menu on technical and emails are in outgoing stage
i have already configured outgoing email 
this is my code:

def action_send_email_qs(self):
​template = self.env.ref("sale_modify.email_template_quote")
​for rec in self:
​if rec.partner_id.email:
​email_values = {'subject': 'Test OM'}
​template.send_mail(rec.id, force_send=True)

help me plz and I will mark your answer as correct!

形象
丢弃
最佳答案

Hi,

You can try this method.

def action_send_email_qs(self):
​template = self.env.ref('sale_modify.email_template_quote')
​for rec in self:
​if rec.partner_id.email:
​template.send_mail(self.id, force_send=True,
​email_values={
​'email_to': rec.partner_id.email,
​'subject': 'Test OM'
​})

Regards

形象
丢弃
相关帖文 回复 查看 活动
1
6月 22
4113
1
1月 22
2505
2
8月 23
2425
2
5月 23
2634
1
4月 23
2820