Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

feat(invite_multiple): Set status of user as `InvitationSent` if `email` feature flag is enabled (#3757)

Mani Chandraef5e886ab1ab
diff --git a/crates/router/src/core/user.rs b/crates/router/src/core/user.rs
index b490912ca6..b38faa3455 100644
--- a/crates/router/src/core/user.rs
+++ b/crates/router/src/core/user.rs
@@ -708,7 +708,13 @@ async fn handle_existing_user_invitation(
merchant_id: user_from_token.merchant_id.clone(),
role_id: request.role_id.clone(),
org_id: user_from_token.org_id.clone(),
- status: UserStatus::Active,
+ status: {
+ if cfg!(feature = "email") {
+ UserStatus::InvitationSent
+ } else {
+ UserStatus::Active
+ }
+ },
created_by: user_from_token.user_id.clone(),
last_modified_by: user_from_token.user_id.clone(),
created_at: now,