Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
2024 Vistas

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
Descartar

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

Mejor respuesta

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
Descartar

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.

Mejor respuesta

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
Descartar

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

Publicaciones relacionadas Respuestas Vistas Actividad
2
jun 25
1504
1
abr 20
4868
2
feb 17
9189
0
jul 22
5207
0
mar 20
2424