Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates at route level #3730

Open
JesusFrontelo opened this issue Feb 21, 2024 · 1 comment
Open

Templates at route level #3730

JesusFrontelo opened this issue Feb 21, 2024 · 1 comment

Comments

@JesusFrontelo
Copy link

Hi!

I'm trying to define a lot of matchers and their corresponding receivers, but I've run into a bit of a problem.

If I want to set up a matcher, based on label severity with the value info (for example), for a receiver, and then I want to set up a matcher based on the same label, but with a different value, and I need the email to be sent with a different template for that particular value, I should also create the receiver again with a different name.

Would it be possible to define templates at the routes level? something like:

  - receiver: Team
    matchers:
    - severity =~ "critical|severe"
    html: '{{ template "email.html" . }}'
    continue: true
  - receiver: Team
    matchers:
    - severity = "info"
    html: '{{ template "email_info.html" . }}'
    continue: true

Regards.

@dswarbrick
Copy link

Have you considered using a single template, but with conditional logic based on the value of the severity label?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants