Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
1092 Tampilan

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

Avatar
Buang
Penulis Jawaban Terbai

Hello,

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

Best,

Avatar
Buang
Jawaban Terbai

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()

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mei 19
4383
0
Apr 21
2262
2
Okt 23
8515
1
Mei 19
5116
1
Mar 19
5359