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

Hello,

Any idea how to make the followers of a sales order or invoice visible to all the recipients. 

It´s happening that a follower is forwarding the email to another follower, since they don´t see all the recipients included in the loop.

Thanks,

Mireia

形象
丢弃
编写者 最佳答案

Hello,

I don´t use codes... can this be done with Studio?

Best,

形象
丢弃
最佳答案

code to get all followers' emails
---------------------------------

followers = self.env['mail.followers'].search([('res_model', '=', 'sale.order'), ('res_id', '=', sale_order_id)])

emails = [follower.partner_id.email for follower in followers]


Add these emails to the Cc field
----------------------------------

email_values = {

    'subject': 'Sales Order Notification',

    'email_to': main_recipient_email,

    'email_cc': ','.join(emails),

    # other email parameters

}


mail = self.env['mail.mail'].create(email_values)

mail.send()

形象
丢弃
相关帖文 回复 查看 活动
1
5月 19
4471
0
4月 21
2353
2
10月 23
8625
1
5月 19
5207
1
3月 19
5442