dynamic/silverstripe-user-invitation

A SilverStripe module to handle user invitations to your secure website.

Maintainers

Package info

github.com/dynamic/silverstripe-user-invitation

Type:silverstripe-vendormodule

pkg:composer/dynamic/silverstripe-user-invitation

Statistics

Installs: 7 850

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 4

2.1.0 2026-06-23 07:18 UTC

README

This module adds the ability to invite users to a secure website (e.g. Intranet or Extranet).

CI Sponsors

Latest Stable Version Total Downloads Latest Unstable Version License

Requirements

  • PHP ^8.3
  • silverstripe/framework ^6
  • lekoala/silverstripe-cms-actions ^2.0

Installation

composer require dynamic/silverstripe-user-invitation

Features

  • Quick-entry invitation form - By default only first name and email fields are required to invite someone
  • Email invitations - Sends email invitations to recipients
  • User group assignment - Supports optional user group assignment (can be made required via configuration)
  • Invitation expiry - Invitation expiry can be set via configuration
  • Member validation - Default SilverStripe member validation is applied
  • CMS interface - Create and send invites from CMS admin interface or frontend form

Usage

This module enables you to invite users to register on your site. Users can be invited from either:

Frontend Form

Frontend invite

CMS Admin Interface

CMS invite

Configuration

Email Configuration

Set a sender address and optional subject override in your app/_config/email.yml:

# Sender address used for invitation emails.
# Can be a plain address or an "email: display name" map (Symfony format).
Dynamic\SilverStripe\UserInvitations\Model\UserInvitation:
  from_email: 'noreply@example.com'
  # Uncomment to override the default "Invitation from {name}" subject:
  # email_subject: 'You have been invited'

If from_email is not set, the module falls back to Email.admin_email:

SilverStripe\Control\Email\Email:
  admin_email: 'noreply@example.com'

Note: At least one of UserInvitation.from_email or Email.admin_email must be configured. If neither is set, sendInvitation() throws a RuntimeException.

For easy email testing, use: https://mailcatcher.me/

Email Template Override

The invitation email uses two templates: an HTML part and a plain-text fallback.

Template Path
HTML templates/email/UserInvitationEmail.ss
Plain text templates/email/UserInvitationEmail_plain.ss

To customise the email appearance, create theme overrides at:

  • themes/<your-theme>/templates/email/UserInvitationEmail.ss
  • themes/<your-theme>/templates/email/UserInvitationEmail_plain.ss

The following variables are available in both templates:

Variable Description
$InviteeName First name of the person being invited
$InviterName First name of the person who sent the invite
$SiteName Site name from SiteConfig
$AcceptLink Full URL to the invitation acceptance page
$ExpiryDate Human-readable expiry date (e.g. June 30, 2025)
$ExpiryDays Number of days until expiry
$Invite The UserInvitation DataObject

Note: Emails render after Requirements::clear() — do not rely on theme CSS bundles. Inline all styles in custom email templates.

Force Required User Group Assignment

To require group selection when inviting users, add the following to your configuration:

Dynamic\SilverStripe\UserInvitations\Model\UserInvitation:
  force_require_group: true

Theme Integration

The accept/registration page (/user/accept/{hash}) renders within your project's theme using a Page fallback. The module's Layout templates are resolved through the standard SilverStripe template hierarchy, so you can override any of them in your theme:

Template Purpose
Layout/Dynamic/SilverStripe/UserInvitations/Control/UserController.ss Invite form (front end)
Layout/Dynamic/SilverStripe/UserInvitations/Control/UserController_accept.ss Registration form
Layout/Dynamic/SilverStripe/UserInvitations/Control/UserController_success.ss Success confirmation
Layout/Dynamic/SilverStripe/UserInvitations/Control/UserController_expired.ss Expired invitation
Layout/Dynamic/SilverStripe/UserInvitations/Control/UserController_notfound.ss Invalid invitation link

Place overrides in themes/<your-theme>/templates/ using the same paths. The Page wrapper (header, navigation, footer, CSS/JS) is provided by your project's Page.ss automatically — you only need to supply the content area.

Note: The module depends only on silverstripe/framework and does not extend PageController. Theme resolution is achieved through the Page fallback in renderWithLayout(). If your project requires deep page-context access (e.g. $SiteConfig, $Navigation), you can still customise templates without any PHP-level changes.

Redirect After Successful User Creation

Set a custom 'BackURL' to redirect users after completing signup from invitation:

Dynamic\SilverStripe\UserInvitations\Control\UserController:
  back_url: '/admin/'

Maintainers

Bugtracker

Bugs are tracked in the issues section of this repository. Before submitting an issue please read over existing issues to ensure yours is unique.

If the issue does look like a new bug:

  • Create a new issue
  • Describe the steps required to reproduce your issue, and the expected outcome. Unit tests, screenshots and screencasts can help here.
  • Describe your environment as detailed as possible: SilverStripe version, Browser, PHP version, Operating System, any installed SilverStripe modules.

Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker.

Development and contribution

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.

License

See License