Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
2329 Widoki

I understand that when I send an email to "Followers" that the CC line is not used, and all followers receive a single email.

Is there any way to modify the email that is sent and add the other recipients so that everyone knows it was sent to multiple people?

Awatar
Odrzuć
Najlepsza odpowiedź

One approach could be to create an Automation Rule that is triggered on Save of the Message that is created to represent the email:




Code:

# custom_ray_odoo

discussions_subtype = env['mail.message.subtype'].search([('name','=','Discussions')])

for record in records:
  if record.model and record.res_id and record.subtype_id == discussions_subtype \
                  and "Also sent to:" not in record.body:
    document = env[record.model].search([('id','=',record.res_id)])
    followers = document.message_partner_ids
    header_note = ''
    for follower in followers:
        if follower != record.author_id:
          header_note += follower.name + ' (' + follower.email + '); '   
    if followers and document:
      record['body'] = 'Also sent to: ' + header_note[:-1] + '\n\n' + record.body
Awatar
Odrzuć
Najlepsza odpowiedź

Use "Email Template" Customization

You can customize your email template to display follower names/emails at the top of the message:

  1. Go to SettingsTechnicalEmailTemplates.
  2. Select or create a template.
  3. In the Body HTML, add something like:

html

CopyEdit

<p><strong>Followers:</strong> <t t-foreach="object.message_follower_ids" t-as="follower"> <t t-esc="follower.partner_id.name"/> &lt;<t t-esc="follower.partner_id.email"/>&gt;; </t> </p>

This adds a line at the top of the email showing all follower names and emails.

Awatar
Odrzuć

This is really helpfull Bhavani, could we also list the full email address after the partner ID name?

Powiązane posty Odpowiedzi Widoki Czynność
2
wrz 25
1827
1
kwi 20
5064
2
wrz 25
9339
2
wrz 25
130
0
lip 22
5312