You've mangled the YAML so it definitely won't work with what you've shown.

You'll need something like this:

- name: 'MoniDashboard'
  email_configs:
  - send_resolved: true
    to: 'vinoth.sundaram@domain1,PrashantKumar.Singh1@domain2'
    headers:
      Subject: "{{ .CommonAnnotations.summary }}"
      To: 'vinoth.sundaram@domain1'
      Cc: 'PrashantKumar.Singh1@domain2'
    require_tls: no

The important thing is that you need the 'to' value to be a comma-separated 
list of recipient addresses.  See:
https://github.com/prometheus/alertmanager/blob/v0.25.0/notify/email/email.go#L230-L238
https://pkg.go.dev/net/mail#ParseAddressList

If it still doesn't work how you want, then you need to be more specific 
about your problem than "this is not working". For example:
- If the message isn't delivered to both receipients, you'll need to look 
at the log output of alertmanager and the logs from your E-mail relay (SMTP 
host)
- If the message is delivered to both receipients, but the "To" and "Cc" 
headers don't appear in the way that you want, then you'll need to show the 
actual message headers that you receive, and explain how they differ from 
what you expected.

On Monday, 23 January 2023 at 06:17:05 UTC [email protected] wrote:

> Hi ,
>
> this is not working , i am not able to receive alerts  in having user  CC 
>
> - name: 'MoniDashboard'
>   email_configs:
>   - send_resolved: true
>     to: 'vinoth.sundaram@
>     headers:
>       subject: "{{ .CommonAnnotations.summary }}"
>       to: 'vinoth.sundaram@
>       CC: 'PrashantKumar.Singh1@
>     require_tls: no
>
>
> Thanks 
> prashant 
>
>
>
>
> On Friday, January 20, 2023 at 7:33:08 PM UTC+5:30 [email protected] 
> wrote:
> Ah, thanks for that addition. Indeed, "to" is handled in a special way 
> here: 
> https://github.com/prometheus/alertmanager/blob/f59460bfd4bf883ca66f4391e7094c0c1794d158/notify/email/email.go#LL230C28-L230C28
>
> Which makes sense given that in SMTP, there's always separate "RCPT TO: 
> <...>" lines (which I guess this translates into) before the body of the 
> email that contains the headers.
>
> On Fri, Jan 20, 2023 at 2:34 PM Julien Pivotto <[email protected]> 
> wrote:
> To send an email with a CC: in alertmanager, it is not sufficient to add a 
> CC: header.
>
> receivers:
> - name: my-receiver
>   email_configs:
>   - to: '[email protected]'
>     headers:
>       subject: 'my subject'
>       CC: '[email protected]'
>
> You also need to add the CC: address to the to: field and explicitely add 
> a to: field.
>
> receivers:
> - name: my-receiver
>   email_configs:
>   - to: '[email protected],[email protected]'
>     headers:
>       subject: 'my subject'
>       To: '[email protected]'
>       CC: '[email protected]'
>
> To send a mail in BCC:, overwrite the To: header and add the BCC addresses 
> to the to: field:
>
> receivers:
> - name: my-receiver
>   email_configs:
>   - to: '[email protected],[email protected]'
>     headers:
>       subject: 'my subject'
>       To: '[email protected]'
>
> On 20 Jan 14:28, Julius Volz wrote:
> > Hi Prashant,
> > 
> > Looking at the email implementation in Alertmanager, "to" should be 
> treated
> > exactly as "cc" internally (just optionally supplied through a dedicated
> > YAML field). It's just another header:
> > 
> https://github.com/prometheus/alertmanager/blob/f59460bfd4bf883ca66f4391e7094c0c1794d158/notify/email/email.go#L53-L70
> > 
> > So I would be surprised if the problem is in Alertmanager itself, rather
> > than something in the email pipeline after it.
> > 
> > Kind regards,
> > Julius
> > 
> > On Fri, Jan 20, 2023 at 1:38 PM Prashant Singh <[email protected]>
> > wrote:
> > 
> > > Dear team,
> > >
> > > prometheus alertmanager CC is not working even as add TO_ and CC_ .
> > >
> > > TO:  it is working
> > > CC: it is not working.
> > >
> > >
> > > - name: 'MoniDashboard'
> > >   email_configs:
> > >   - send_resolved: true
> > >     to: 'vinoth.sundaram
> > >     headers:
> > >       cc: 'PrashantKumar.Singh1'
> > >     require_tls: no
> > >
> > > thanks
> > > Prashant
> > >
> > > --
> > > You received this message because you are subscribed to the Google 
> Groups
> > > "Prometheus Users" group.
> > > To unsubscribe from this group and stop receiving emails from it, send 
> an
> > > email to [email protected].
> > > To view this discussion on the web visit
> > > 
> https://groups.google.com/d/msgid/prometheus-users/9987573c-ed69-4fb2-94aa-4c37870c540dn%40googlegroups.com
> > > <
> https://groups.google.com/d/msgid/prometheus-users/9987573c-ed69-4fb2-94aa-4c37870c540dn%40googlegroups.com?utm_medium=email&utm_source=footer
> >
> > > .
> > >
> > 
> > 
> > -- 
> > Julius Volz
> > PromLabs - promlabs.com
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Prometheus Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected].
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/prometheus-users/CAObpH5wv7WVme5ysp720Cj815fJdwATria-%2B0yDW0sG46_82XA%40mail.gmail.com
> .
>
> -- 
> Julien Pivotto
> @roidelapluie
>
>
> -- 
> Julius Volz
> PromLabs - promlabs.com
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/755c9cf1-3e3b-4d33-8fda-6337acbe8911n%40googlegroups.com.

Reply via email to