Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
2332 Zobrazení

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?

Avatar
Zrušit
Nejlepší odpověď

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
Avatar
Zrušit
Nejlepší odpověď

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.

Avatar
Zrušit

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

Related Posts Odpovědi Zobrazení Aktivita
2
zář 25
1828
1
dub 20
5064
2
zář 25
9339
2
zář 25
136
0
čvc 22
5312