Skip to content

Commit

Permalink
Fix email notifier subject when nodes is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriansaliou committed Aug 11, 2023
1 parent da1993f commit 3ff07dc
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/notifier/email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ impl GenericNotifier for EmailNotifier {
Some(APP_CONF.branding.page_title.to_owned()),
email_config.from.parse::<Address>().or(Err(true))?,
))
.subject(format!(
"{} | {}",
notification.status.as_str().to_uppercase(),
&nodes_label
))
.subject(if nodes_label.is_empty() {
notification.status.as_str().to_uppercase()
} else {
format!(
"{} | {}",
notification.status.as_str().to_uppercase(),
&nodes_label
)
})
.body(message)
.or(Err(true))?;

Expand Down

0 comments on commit 3ff07dc

Please sign in to comment.