Skip to content

Update email action to invite users who don't have accounts #1002

@gabestein

Description

@gabestein

Motivation

So an admin can send emails with forms to people who create discussions and thus are not (yet) members. In this case, it's to create a discussion verification flow for users where we're collecting email addresses on the front-end and want to create memberships for them as part of that flow.

The other cool thing this does is essentially allows you to create custom magic link flows for different workflows (via API or otherwise). E.g., you can have someone:

  1. Enter their email address on a public-facing site, which creates a pub
  2. Have that creation trigger a form invite that simply asks them to verify their account
  3. Have submitting that form trigger another form invite to fill out the original form

Requirements

  • If an email action containing an invite is sent to an email address field (as opposed to a member)...
    • If the member for that email already exists, it sends it to that user and allows them to login with the invite link as normal and then redirects them to fill out the form as usual
    • If the member does not exist, it creates an account for them and then sends a link that redirects them to fill out the invited form with the new created account
  • Invite can only be used to fill out form from newly created account/email

Acceptance Criteria

  • Action flow:
    • Action detects no account/member when run, and creates new account for specified email without sending a normal invite email
    • Action creates a form permission for the form/pub pair and the new account
    • Action rewrites form link from direct link to the form to a typical account setup invitation link, adding a redirectTo= parameter that redirects to the form with pub ID
    • User clicks on link, and is prompted to finish setting up account
    • After account setup, setup page reads redirect param and forwards logged in user to pub form
  • Update account setup page to accept redirect (if doesn't already)
  • Documentation update to Logging In, Email Action, Membership

Extra work

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions