feat(ses_email): add email services to hyperswitch (#2977)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Gnanasundari24 <118818938+Gnanasundari24@users.noreply.github.com>
This commit is contained in:
Narayan Bhat
2023-11-29 16:12:12 +05:30
committed by GitHub
parent 37ab392488
commit 5f5e895f63
18 changed files with 1861 additions and 97 deletions

View File

@ -70,6 +70,28 @@ pub async fn connect_account(
.get_jwt_auth_token(state.clone(), user_role.org_id)
.await?;
#[cfg(feature = "email")]
{
use router_env::logger;
use crate::services::email::types as email_types;
let email_contents = email_types::WelcomeEmail {
recipient_email: domain::UserEmail::from_pii_email(user_from_db.get_email())?,
settings: state.conf.clone(),
};
let send_email_result = state
.email_client
.compose_and_send_email(
Box::new(email_contents),
state.conf.proxy.https_url.as_ref(),
)
.await;
logger::info!(?send_email_result);
}
return Ok(ApplicationResponse::Json(api::ConnectAccountResponse {
token: Secret::new(jwt_token),
merchant_id: user_role.merchant_id,