mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 12:06:56 +08:00
feat(users): Send welcome to community email in magic link signup (#6639)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -246,26 +246,41 @@ pub async fn connect_account(
|
||||
)
|
||||
.await?;
|
||||
|
||||
let email_contents = email_types::VerifyEmail {
|
||||
let magic_link_email = email_types::VerifyEmail {
|
||||
recipient_email: domain::UserEmail::from_pii_email(user_from_db.get_email())?,
|
||||
settings: state.conf.clone(),
|
||||
subject: consts::user::EMAIL_SUBJECT_SIGNUP,
|
||||
auth_id,
|
||||
};
|
||||
|
||||
let send_email_result = state
|
||||
let magic_link_result = state
|
||||
.email_client
|
||||
.compose_and_send_email(
|
||||
Box::new(email_contents),
|
||||
Box::new(magic_link_email),
|
||||
state.conf.proxy.https_url.as_ref(),
|
||||
)
|
||||
.await;
|
||||
|
||||
logger::info!(?send_email_result);
|
||||
logger::info!(?magic_link_result);
|
||||
|
||||
let welcome_to_community_email = email_types::WelcomeToCommunity {
|
||||
recipient_email: domain::UserEmail::from_pii_email(user_from_db.get_email())?,
|
||||
subject: consts::user::EMAIL_SUBJECT_WELCOME_TO_COMMUNITY,
|
||||
};
|
||||
|
||||
let welcome_email_result = state
|
||||
.email_client
|
||||
.compose_and_send_email(
|
||||
Box::new(welcome_to_community_email),
|
||||
state.conf.proxy.https_url.as_ref(),
|
||||
)
|
||||
.await;
|
||||
|
||||
logger::info!(?welcome_email_result);
|
||||
|
||||
return Ok(ApplicationResponse::Json(
|
||||
user_api::ConnectAccountResponse {
|
||||
is_email_sent: send_email_result.is_ok(),
|
||||
is_email_sent: magic_link_result.is_ok(),
|
||||
user_id: user_from_db.get_user_id().to_string(),
|
||||
},
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user