-
-pub fn send_email_to_user(
- local_user_view: &LocalUserView,
- subject_text: &str,
- body_text: &str,
- comment_content: &str,
- settings: &Settings,
-) {
- if local_user_view.person.banned || !local_user_view.local_user.send_notifications_to_email {
- return;
- }
-
- if let Some(user_email) = &local_user_view.local_user.email {
- let subject = &format!(
- "{} - {} {}",
- subject_text, settings.hostname, local_user_view.person.name,
- );
- let html = &format!(
- "<h1>{}</h1><br><div>{} - {}</div><br><a href={}/inbox>inbox</a>",
- body_text,
- local_user_view.person.name,
- comment_content,
- settings.get_protocol_and_hostname()
- );
- match send_email(
- subject,
- user_email,
- &local_user_view.person.name,
- html,
- settings,
- ) {
- Ok(_o) => _o,
- Err(e) => error!("{}", e),
- };
- }
-}