Invite people to your app by email
Your app's users can invite someone into their org. SaaSLayer emails the invitation, and the invitee joins from the link on one screen: no code to copy and no second sign-in. This page covers your app's runtime orgs. Teammates on SaaSLayer itself are covered in Team access.
Your app draws the invite and accept screens with the SDK. This integration is Preview. Use a compatible SDK build for your deployment. Before enabling delivery, deploy Users and Permissions from the same release, configure an email sender and provide an invitation accept page.
What the inviter sees
- The inviter enters an email address and picks roles, then clicks Invite. Your backend creates the invitation with
delivery: 'email'and the inviter's name, then asks SaaSLayer to send it (@saaslayer/js:createInvitation, thensendInvitationEmail). - The pending list shows each invitation's send count (out of 5), when it was last sent, and Resend.
- Resend sends a fresh email. The link in the earlier email stops working, so only the newest email works.
- After 5 sends, Resend is refused. Revoke the invitation and invite again.
- Copy link instead is for an inviter who wants to pass the link on themselves. It revokes the emailed invitation and creates a link invitation with the same email and roles. An invitee who opens a copied link also enters a 6-digit code that SaaSLayer mails to the invited address, because the inviter has seen that link.
"Sent" means the email service accepted the message. It doesn't mean the email reached the inbox. If the invitee can't find it, check their spam folder, then use Resend.
What the invitee sees
- An email from your app's sender: "Sam Lee invited you to join Acme" (or "You've been invited to join Acme" when no inviter name was given), with an Accept invitation button. It names the invited address and when the invitation expires.
- The button opens your accept page. It shows the org, the roles and their email address, which can't be changed.
- New to your app: they choose a password and are signed in and joined in one step. The link itself proves they own the mailbox, so no code is needed.
- Already have an account: they sign in with that email, then accept.
- After accepting they land in the invited org.
A link from an older email, a revoked invitation or an expired one is refused as not found.
Forwarded emails
Anyone who holds an emailed link can create the invited account and choose its password. That includes someone the invitee forwarded the email to. Treat the link as a bearer credential: it can create the account for the invited address and join it to the invited org with the invited roles. Until the link is used, revoking the invitation stops it, and Resend makes the old link stop working. Tell invitees not to forward the email.
Setting it up
- Your app needs an accept page. Invitation links open
AppUrl+/accept-inviteby default (anAppUrlwith a base path keeps it:https://example.com/app/accept-invite). Change the path withsaaslayer deployment settings set --env <env> --set user-service.InvitationAcceptPath=/join. - Invitation emails go out from your deployment's email sender (
CognitoEmailFromAddress). Without a sender or anAppUrl, sending is turned off. See Configure your email sender. - Customize the wording in the console's Emails page under "Invitation email". The code email for copied links is "Invitation verification code", and it names the org being joined.
- Deploy user-service and permissions-service from the same release, and use
@saaslayer/js/@saaslayer/reactfrom a compatible release build.
Developer reference: the @saaslayer/js README ("Emailed invitations") and
invitation API reference.