sendInvitation($invitation)
Sends an invitation e-mail to the recipient specified in the invitation object. The e-mail contains a registration link that the invitee can use to create their account. The content and subject of the e-mail are determined by the invitation-mail expression configured in the InvitationModule.
To use this function, the tl-security-selfservice module must be included in the application and e-mail dispatch must be configured.
| Name | Type | Description | Mandatory | Default |
|---|---|---|---|---|
| invitation | Business object (tl.security.selfservice:Invitation) |
The invitation whose recipient should receive the invitation e-mail. The invitation must have a valid e-mail address set in its email attribute. |
yes |
Type: Truth value
Whether the invitation e-mail was sent successfully.
sendInvitation($invitation)
Output: true
Sends the invitation e-mail to the address stored in the email attribute of $invitation.
{
invitation = new(`tl.security.selfservice:Invitation`);
set($invitation, `tl.security.selfservice:Invitation#email`, "new.user@example.com");
sendInvitation($invitation);
}
Output: true
Creates a new invitation for the given e-mail address and immediately sends the invitation e-mail.