+10
-2
src/main.rs
+10
-2
src/main.rs
···
133
133
AsyncSmtpTransport::<Tokio1Executor>::from_url(smtp_url.as_str())?.build();
134
134
//Email templates setup
135
135
let mut hbs = Handlebars::new();
136
-
//TODO add an override to manually load in the hbs templates
137
-
let _ = hbs.register_embed_templates::<EmailTemplates>();
136
+
137
+
let users_email_directory = env::var("GATEKEEPER_EMAIL_TEMPLATES_DIRECTORY");
138
+
if let Ok(users_email_directory) = users_email_directory {
139
+
hbs.register_template_file(
140
+
"two_factor_code.hbs",
141
+
format!("{users_email_directory}/two_factor_code.hbs"),
142
+
)?;
143
+
} else {
144
+
let _ = hbs.register_embed_templates::<EmailTemplates>();
145
+
}
138
146
139
147
let pds_base_url =
140
148
env::var("PDS_BASE_URL").unwrap_or_else(|_| "http://localhost:3000".to_string());