Skip to Content
Menu
This question has been flagged
2 Replies
2021 Views

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
Discard

Hi,

First off all: thank you for your tutorial!

I tried to implement it like this, but get the following error:

RPC_ERROR

Odoo Server Error

Occured on - on model helpdesk.ticket and id 32 on 2025-03-10 07:02:34 GMT

Traceback (most recent call last):
  File "/home/odoo/src/odoo/saas-18.1/odoo/tools/safe_eval.py", line 397, in safe_eval
    return unsafe_eval(c, globals_dict, locals_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "ir.actions.server(1424,)", line 6, in <module>
AttributeError: 'helpdesk.ticket' object has no attribute 'model'

If you could help me on this, I would highly appreciate it!

Regards
Lukas

Best Answer

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
Discard

You can switch the order of things in the last line:

record['body'] = record.body + '\n\nAlso sent to: ' + header_note[:-1]

Please work with your Odoo Digital Advisor or Odoo Partner if you need further help.

Best Answer

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
Discard

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

Related Posts Replies Views Activity
2
Jun 25
1500
1
Apr 20
4867
2
Feb 17
9188
0
Jul 22
5206
0
Mar 20
2419