How to pass entity label in Sensu Email Handler definition

Hi team,

Could you please help me how can we pass entity label email into sensu go email handler definition…

Trying below but not working…

api_version: core/v2
type: Handler
metadata:
namespace: default
name: email-template
spec:
type: pipe
command: sensu-email-handler -i -f sensu@xyz.local -t {{.Entity.Labels.email}} -s smtp.xyz.local -T /etc/sensu/email_template_test -u nill -p nil
timeout: 10
filters:
- is_incident
- not_silenced
- fatigue_check
runtime_assets:
- sensu-email-handler

1 Like

Perhaps this annotation-based configuration override is what you’re looking for?

The sensu-email-handler --toEmail flag value can also be provided via a check or entity annotation called sensu.io/plugins/email/config/toEmail.

I hope this helps!