Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
2331 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
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
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
sept 25
1828
1
abr 20
5064
2
sept 25
9339
2
sept 25
134
0
jul 22
5312