icon picker
Invitations

What this is:

If one of your users invites someone else to become a user in the app. Typically this is a B2B scenario, so the setup below follows that app structure. (This ties into to the setup.)

The wrong way:

Using the “create a user on behalf of someone else” action.
This isn’t ideal because:
You could easily end up with lots of “ghost” users who never actually sign use your app.
If someone who was invited tries to sign up on their own, they’ll have problems because they’ve already got an account. This would be confusing for them, and you’d have to build UI and logic to account for that (inevitable) edge case.
If the person who send the invitation change their mind, it’s tricky to handle that now that the user is already created.
I just don’t like creating user records for people who haven’t actually agreed to use my app.

How I do it:

Create an “Invitation” data type, w/ these fields:
Field Name
Field Type
DT/OS
List
Notes
Invited Person First Name
Invited Person Last Name
Invited Person Email
User (Creator)
Company
If B2B
User<>Entity Permission Level
This will get applied to the record once the user signs up.
Role
If B2B and if the app actually uses Roles
Date Expires
User (Created)
Status
(see below)
No results from filter

What you do with this data type:

This is created by an active user of your app. When they create it, you’ll need logic that sends an email to the invited person which includes a link to your app’s signup page. This link needs to include the invitation record’s
@UID
in it somewhere, probably in a URL parameter (i.e., https://myapp.com/signup?invitation=[UID]).
You’ll need to build some logic on your “Sign Up” page that looks at the URL, and if there’s an invitation in it your app should...
Search the database for that record in the database and check to make sure the status is
@Open
. If it’s any other status, you’ll need to handle it with messages to the person signing up with in the UI (example: This invitation is expired - reach out to your contact at XYZ Company to have them resend a new invitation)
If the Invite is good, when they sign up, you should send the Invitation record and the User record to a backend workflow, which:
Creates the record - this should map the Permission Level and Role fields from the Invite to the new record that gets created.
Change the status of the Invitation to “User Signed Up” and adds the user that signed up to the “User Created” field.
Sends the “User (Creator)” an email letting them know that the person signed up.

Notes:

Expiration: When the invitation is created, you’ll need to schedule a backend workflow that marks it as expired on the expiration date. You’ll probably also want some way for admins of that company to renew the invitation to open it up again. (In this case, I don’t create a new invitation - I just change the expiration date. (How to do this is laid out as an example on the page.)
Already-Active Users: This works really well if the user already exists and just needs to be “added” to a company’s account. The only difference in the flow is that instead of signing them up, you just log them in, and run the “Create Permissions” backend workflow exactly the same way.

Option Sets - Example Options

Invitation Status
Display
Notes
Draft
(optional)
Open
This is the only status where the person can sign up with the invitation.
Expired
User Created
No results from filter

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.