Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove e-mail verification success e-mails #3124

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions crates/api/src/local_user/verify_email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use actix_web::web::Data;
use lemmy_api_common::{
context::LemmyContext,
person::{VerifyEmail, VerifyEmailResponse},
utils::send_email_verification_success,
};
use lemmy_db_schema::{
source::{
Expand All @@ -12,7 +11,6 @@ use lemmy_db_schema::{
},
traits::Crud,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::LemmyError;

#[async_trait::async_trait(?Send)]
Expand All @@ -35,10 +33,6 @@ impl Perform for VerifyEmail {

LocalUser::update(context.pool(), local_user_id, &form).await?;

let local_user_view = LocalUserView::read(context.pool(), local_user_id).await?;

send_email_verification_success(&local_user_view, context.settings())?;

EmailVerification::delete_old_tokens_for_local_user(context.pool(), local_user_id).await?;

Ok(VerifyEmailResponse {})
Expand Down
11 changes: 0 additions & 11 deletions crates/api_common/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,17 +403,6 @@ pub async fn send_verification_email(
Ok(())
}

pub fn send_email_verification_success(
user: &LocalUserView,
settings: &Settings,
) -> Result<(), LemmyError> {
let email = &user.local_user.email.clone().expect("email");
let lang = get_interface_language(user);
let subject = &lang.email_verified_subject(&user.person.actor_id);
let body = &lang.email_verified_body();
send_email(subject, email, &user.person.name, body, settings)
}

pub fn get_interface_language(user: &LocalUserView) -> Lang {
lang_str_to_lang(&user.local_user.interface_language)
}
Expand Down