[Draft] Implement Reviewer Notice Link using Login Redirect #40

Merged
ben merged 5 commits from ben/Jobboerse:notice-link-via-login into main 2023-01-28 18:00:15 +01:00
3 changed files with 8 additions and 2 deletions
Showing only changes of commit a24f8ca7ee - Show all commits

fix too much escaping

Bennet Bleßmann 2023-01-28 17:58:35 +01:00 committed by Bennet Bleßmann
Signed by: ben
GPG key ID: 3BE1A1A3CBC3CF99

View file

@ -6,7 +6,7 @@ use handlebars::Handlebars;
use lettre::message::header::{Header, HeaderName, HeaderValue, UserAgent};
use lettre::message::{Mailbox, SinglePart};
use lettre::{Address, AsyncTransport};
use log::warn;
use log::{warn, debug};
use serde_json::json;
use url::Url;
@ -78,6 +78,8 @@ pub(crate) async fn send_reviewer_notice(
.query_pairs_mut()
.append_pair(RETURN_TO, highlight_url.as_str());
debug!("Url:\n{login_url}");
let body = match hb.render(
template::EMAIL_REVIEWER_NOTICE,
&json!({ "highlight_link": login_url }),
@ -89,6 +91,8 @@ pub(crate) async fn send_reviewer_notice(
}
};
debug!("Sending:\n{body}");
let message = lettre::Message::builder()
.from(email_config.from.to_owned())
.to(email_config.from.to_owned())

View file

@ -1,3 +1,3 @@
Automatischer Hinweis: Eine neue Stellenausschreibung wurde zur Jobbörse eingereicht!
{{highlight_link}}
{{{highlight_link}}}

View file

@ -8,6 +8,8 @@ RUN_DIR="${DIR}/../packages/jobboerse"
pushd "${RUN_DIR}"
export RUST_LOG=debug
cargo watch \
-i ./packages/jobboerse/config/dev-config.toml \
-x "run --package jobboerse --bin jobboerse --release --features=dev_mode -- --config=\"${CFG}\" --mode=development"