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

The {{HOSTNAME_OR_URL}} placeholder used for the custom Email notify subject is NULL for Monitor Type=Group #5640

Open
1 task done
computrav opened this issue Feb 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@computrav
Copy link

πŸ“‘ I have found these related issues/pull requests

n/a

πŸ›‘οΈ Security Policy

Description

I customized my email subject to the following:
[{{STATUS}}] {{NAME}} - {{HOSTNAME_OR_URL}}

However, because "Group" monitor types don't have a hostname or URL, the value is Null. That's fine of course, but it appears literally as "null" when used in the email subject, e.g.:
[βœ… Up] Main Web Server - null

So the bug is that the {{HOSTNAME_OR_URL}} should be handled properly for monitor types that don't have a hostname/URL (Group and maybe others). Also, perhaps instead of just using an empty string, use "n/a"? For my template above, for example, if it were blank it would show up as:
[βœ… Up] Main Web Server -

but instead maybe this is better?
[βœ… Up] Main Web Server - n/a

I'm not sure :)

πŸ‘Ÿ Reproduction steps

  1. Setup an email notification and customize the email subject to utilize {{HOSTNAME_OR_URL}}
  2. Create a Group monitor and turn on the Email notification for it
  3. Add another regular monitor to it
  4. Trigger an email (make the monitor UP/DOWN)

πŸ‘€ Expected behavior

null does not show in the email subject.

πŸ˜“ Actual Behavior

The literal string "null" shows.

🐻 Uptime-Kuma Version

1.23.16

πŸ’» Operating System and Arch

Debian

🌐 Browser

n/a

πŸ–₯️ Deployment Environment

n/a

πŸ“ Relevant log output

@computrav computrav added the bug Something isn't working label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant