This module adds the ability to invite users to a secure website (e.g. Intranet or Extranet).
- PHP ^8.3
- silverstripe/framework ^6
- lekoala/silverstripe-cms-actions ^2.0
composer require dynamic/silverstripe-user-invitation- 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
This module enables you to invite users to register on your site. Users can be invited from either:
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_emailorEmail.admin_emailmust be configured. If neither is set,sendInvitation()throws aRuntimeException.
For easy email testing, use: https://mailcatcher.me/
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.ssthemes/<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.
To require group selection when inviting users, add the following to your configuration:
Dynamic\SilverStripe\UserInvitations\Model\UserInvitation:
force_require_group: trueThe 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/frameworkand does not extendPageController. Theme resolution is achieved through thePagefallback inrenderWithLayout(). If your project requires deep page-context access (e.g.$SiteConfig,$Navigation), you can still customise templates without any PHP-level changes.
Set a custom 'BackURL' to redirect users after completing signup from invitation:
Dynamic\SilverStripe\UserInvitations\Control\UserController:
back_url: '/admin/'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.
If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.
See License

