From 853eda6860163a9ae2c7332793202f5e728748c9 Mon Sep 17 00:00:00 2001 From: RandithaK Date: Thu, 12 Mar 2026 17:44:36 +0530 Subject: [PATCH 1/4] feat: add email sent confirmation to invite user flow --- .../auth/InviteUser/v2/BaseInviteUser.tsx | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/react/src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx b/packages/react/src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx index cf0511f8..390562e8 100644 --- a/packages/react/src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx +++ b/packages/react/src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx @@ -108,6 +108,11 @@ export interface BaseInviteUserRenderProps { */ isInviteGenerated: boolean; + /** + * Whether the invite email was sent successfully. + */ + isEmailSent: boolean; + /** * Loading state. */ @@ -267,6 +272,7 @@ const BaseInviteUser: FC = ({ const [touchedFields, setTouchedFields] = useState>({}); const [inviteLink, setInviteLink] = useState(); const [inviteLinkCopied, setInviteLinkCopied] = useState(false); + const [emailSent, setEmailSent] = useState(false); const [isFormValid, setIsFormValid] = useState(true); const initializationAttemptedRef: any = useRef(false); @@ -437,6 +443,11 @@ const BaseInviteUser: FC = ({ onInviteLinkGenerated?.(inviteLinkValue, response.flowId); } + // Check if email was sent successfully + if (response.data?.additionalData?.['emailSent'] === 'true') { + setEmailSent(true); + } + // Check for error status if (response.flowStatus === 'ERROR') { handleError(response); @@ -501,6 +512,7 @@ const BaseInviteUser: FC = ({ setTouchedFields({}); setInviteLink(undefined); setInviteLinkCopied(false); + setEmailSent(false); initializationAttemptedRef.current = false; }, []); @@ -624,6 +636,7 @@ const BaseInviteUser: FC = ({ const {title, subtitle} = extractHeadings(components); const componentsWithoutHeadings: any = filterHeadings(components); const isInviteGenerated: any = !!inviteLink; + const isEmailSent: boolean = emailSent; // Render props const renderProps: BaseInviteUserRenderProps = { @@ -637,6 +650,7 @@ const BaseInviteUser: FC = ({ handleSubmit, inviteLink, inviteLinkCopied, + isEmailSent, isInviteGenerated, isLoading, isValid: isFormValid, @@ -695,7 +709,33 @@ const BaseInviteUser: FC = ({ ); } - // Invite link generated - success state + // Invite email sent successfully - show email sent confirmation + if (isInviteGenerated && isEmailSent) { + return ( + + + + Invite Email Sent! + + + + + + An invitation email has been sent successfully. The user can complete their registration using the link in + the email. + + +
+ +
+
+
+ ); + } + + // Invite link generated but email not sent - show copy link fallback if (isInviteGenerated && inviteLink) { return ( From fa14d22e2fb59059c30d2771d1e5c923226d4e96 Mon Sep 17 00:00:00 2001 From: RandithaK Date: Thu, 12 Mar 2026 17:55:26 +0530 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20add=20changeset=20=F0=9F=A6=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/rude-zebras-dress.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/rude-zebras-dress.md diff --git a/.changeset/rude-zebras-dress.md b/.changeset/rude-zebras-dress.md new file mode 100644 index 00000000..2c768dad --- /dev/null +++ b/.changeset/rude-zebras-dress.md @@ -0,0 +1,5 @@ +--- +'@asgardeo/react': patch +--- + +Support for Invite Link to be sent via email and direct share From 6020ab3007dd0a12086189671fe6134967241782 Mon Sep 17 00:00:00 2001 From: Kulasekera <154749626+RandithaK@users.noreply.github.com> Date: Thu, 12 Mar 2026 18:07:34 +0530 Subject: [PATCH 3/4] Update .changeset/rude-zebras-dress.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .changeset/rude-zebras-dress.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/rude-zebras-dress.md b/.changeset/rude-zebras-dress.md index 2c768dad..96a30b43 100644 --- a/.changeset/rude-zebras-dress.md +++ b/.changeset/rude-zebras-dress.md @@ -2,4 +2,4 @@ '@asgardeo/react': patch --- -Support for Invite Link to be sent via email and direct share +Support sending invite links via email, with direct link sharing as a fallback. From 65f7cba77457dc06537c8a79788d8369b5417765 Mon Sep 17 00:00:00 2001 From: RandithaK Date: Thu, 12 Mar 2026 21:27:55 +0530 Subject: [PATCH 4/4] refactor: swap invite email and invite link status properties for clarity --- .../presentation/auth/InviteUser/v2/BaseInviteUser.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react/src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx b/packages/react/src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx index 390562e8..dc59d2e5 100644 --- a/packages/react/src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx +++ b/packages/react/src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx @@ -104,14 +104,14 @@ export interface BaseInviteUserRenderProps { inviteLinkCopied: boolean; /** - * Whether the invite link has been generated (admin flow complete). + * Whether the invite email was sent successfully. */ - isInviteGenerated: boolean; + isEmailSent: boolean; /** - * Whether the invite email was sent successfully. + * Whether the invite link has been generated (admin flow complete). */ - isEmailSent: boolean; + isInviteGenerated: boolean; /** * Loading state.