fix: only send email on demand
fix: format mail as html
This commit is contained in:
parent
4cd2e8216f
commit
ccd7e952cc
|
@ -56,7 +56,7 @@ pub fn send_notification(
|
||||||
"PR-tracker: {pr_number}: {pr_title} has reached {:?}",
|
"PR-tracker: {pr_number}: {pr_title} has reached {:?}",
|
||||||
branches
|
branches
|
||||||
))
|
))
|
||||||
.header(ContentType::TEXT_PLAIN)
|
.header(ContentType::TEXT_HTML)
|
||||||
.body(body)
|
.body(body)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|
16
src/main.rs
16
src/main.rs
|
@ -201,13 +201,15 @@ async fn update_subscribers<S>(_request: Request<S>) -> http_types::Result<Respo
|
||||||
println!("{:#?}", val);
|
println!("{:#?}", val);
|
||||||
let to_do = ¤t - &val;
|
let to_do = ¤t - &val;
|
||||||
println!("They will be notified for: {:#?}", to_do);
|
println!("They will be notified for: {:#?}", to_do);
|
||||||
send_notification(
|
if !to_do.is_empty() {
|
||||||
&file_name,
|
send_notification(
|
||||||
&to_do,
|
&file_name,
|
||||||
page.pr_number.as_ref().unwrap(),
|
&to_do,
|
||||||
page.pr_title.as_ref().unwrap(),
|
page.pr_number.as_ref().unwrap(),
|
||||||
!remaining,
|
page.pr_title.as_ref().unwrap(),
|
||||||
)?;
|
!remaining,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !remaining {
|
if !remaining {
|
||||||
|
|
Loading…
Reference in a new issue