Skip to content

Allow sending email invites to people who are not already users on the platform #114

Closed
@chriscarrollsmith

Description

@chriscarrollsmith

Currently the invite functionality on the organization page doesn't trigger any email flow. It only adds a user if they have already registered.

flowchart TD
    %% Invitation Creation Process
    A[Inviter enters email & selects role] --> B{Validation}
    B -->|Valid| C[Generate unique token]
    B -->|Invalid| B1[Show error message]
    C --> D[Create Invitation record]
    D --> E[Send email with token link]
    E --> F[Show success message]
    
    %% Invitation Acceptance Process
    G[Invitee clicks link in email] --> H[Browser loads /invitations/accept]
    H --> I{Validate token}
    I -->|Invalid/Expired| I1[Show error page]
    I -->|Valid| J{Invitee has account?}
    
    %% User has account branch
    J -->|Yes| K{User logged in?}
    K -->|Yes| L{Email matches?}
    L -->|Yes| M[Add user to org with role]
    L -->|No| N[Show error: wrong account]
    K -->|No| O[Redirect to login with token]
    O --> P[User logs in]
    P --> L
    
    %% User doesn't have account branch
    J -->|No| Q[Redirect to register with email & token]
    Q --> R[User registers]
    R --> S[Add new user to org with role]
    
    %% Final steps
    M --> T[Mark invitation as used]
    S --> T
    T --> U[Redirect to organization page]
Loading

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions