4JK5O45HRXZ7BFIGM226RMFEUFXNX2O4IHCFRDSBH356DUG5674QC
ZRU62WXDVY32ZF7AUYONXUQUAKZZGCUFWAYYBA32OXEBARVDVSNAC
WLWTNO4YJ4VBMJYVTP2LGPFQAJTOB524BD5INJFA44X2FKAX76DQC
HZDCKIXQ3LCD7YPL7ZZBCRMD7YMKDJ2QAALETTG3FYMBF4TNFUBAC
TRBYOQBIJPJ72SX3TPI2OAKBUQH6FWVHTKT45LS2HVMBCAWCTULQC
I6SOPEQFWSSOZL7SWTQQK7OXEYZX62WVCLAMCKHFWGBA3OYALSJAC
WVHXYKCVPKAFVMXBEMD3IHG54RKOIDSOCVNR3OIPEZQG36IGYJZQC
EVP2FSBHQUCAXQ6IIMBD6IS24ODKHP6HFWYCHIMYG6KOFRQG3RVQC
4MZ4VIR7FU3PQ3WKJI6TJIKYOIIBODFEPKLMQ32S4AKPZSDFO6AQC
Z3SYSC25TVJBLI4JBYM3OCBK7DYCC2BKPAYW6OVTN2ILFQ4ANUMQC
7R6HAATP4CKWKNOFWAVCZFJVF6LADPHHIINR37PYNGAWGCTBJSJQC
BCXEUKX6RVE4UQE46ITSQY2NXYK3MJT7HHL7CJOM7T4OOOCADMIAC
if form.contact_type != "email" {
log::warn!("Unknown data for contact type: {}", form.contact_type);
return HttpResponse::BadRequest().body("Incorrect");
}
let protocol = match form.contact_type.as_str() {
"email" => Protocol::Email,
"xmpp" => Protocol::Xmpp,
_ => {
log::warn!("Unknown data for contact type: {}", form.contact_type);
return HttpResponse::BadRequest().body("Incorrect");
}
};
log::info!(
"Sending {} type {} to {}",
token_url,
form.contact_type,
form.login
);
match protocol {
Protocol::Email => {
if let Err(e) =
send_email(&data.mailer, &data.mailer_from, token_url, &form.contact).await
{
log::error!("Cann't send email: {}", e);
return HttpResponse::ServiceUnavailable().body(actix_web::body::None::new());
}
}
Protocol::Xmpp => {}
};