fix: only send email on demand

fix: format mail as html
This commit is contained in:
Patrick 2024-07-19 22:57:59 +02:00
parent 4cd2e8216f
commit ccd7e952cc
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
2 changed files with 10 additions and 8 deletions

View file

@ -56,7 +56,7 @@ pub fn send_notification(
"PR-tracker: {pr_number}: {pr_title} has reached {:?}",
branches
))
.header(ContentType::TEXT_PLAIN)
.header(ContentType::TEXT_HTML)
.body(body)
.unwrap();

View file

@ -201,13 +201,15 @@ async fn update_subscribers<S>(_request: Request<S>) -> http_types::Result<Respo
println!("{:#?}", val);
let to_do = &current - &val;
println!("They will be notified for: {:#?}", to_do);
send_notification(
&file_name,
&to_do,
page.pr_number.as_ref().unwrap(),
page.pr_title.as_ref().unwrap(),
!remaining,
)?;
if !to_do.is_empty() {
send_notification(
&file_name,
&to_do,
page.pr_number.as_ref().unwrap(),
page.pr_title.as_ref().unwrap(),
!remaining,
)?;
}
}
}
if !remaining {