MemberAuthMethodEmail
Reference for the MemberAuthMethodEmail module: the email-based member authentication method. It provides the register, login and forgot-password forms and the classes that send login, forgot-password and verification codes to a member by email, drawing the sender and template content from Config callables.
This page is a pure reference. For how the framework fits together, see the Guide.
MemberAuthMethodEmailUi- the register, login and forgot-password forms.MemberAuthMethodEmailForgotCode- send a forgot-password code by email.MemberAuthMethodEmailLoginCode- send a login code by email.MemberAuthMethodEmailVerifyCode- send, resend and complete an email verification code.
MemberAuthMethodEmailUi
The forms for the email authentication method: the registration form, the login form and the forgot-password form. Each renders an action form and handles its own submission.
ForgotPasswordForm
MemberAuthMethodEmailUi::ForgotPasswordForm(): void
Render the forgot-password form, which takes an email address, and handle its submission by requesting a password reset code and redirecting to the code entry page.
Returns void
LoginForm
MemberAuthMethodEmailUi::LoginForm(): void
Render the login form, which takes an email address and password, and handle its submission by verifying the password, sending a verification code when the account is not yet verified, or logging the member in.
Returns void
RegisterForm
MemberAuthMethodEmailUi::RegisterForm(): void
Render the registration form, which takes an email address and a new password, and handle its submission by creating the member, auth and password records and sending a login code by email.
Returns void
MemberAuthMethodEmailForgotCode
Sends a forgot-password code to a member by email, using the forgot-password subject, text and HTML templates and the sender name and email from Config.
SendCode
MemberAuthMethodEmailForgotCode::SendCode(int $memberId, MemberCodeData $codeData): void
Send a forgot-password code to the member by email, building the subject, text and HTML bodies and the sender from the module's Config callables.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member to send the code to. |
$codeData | MemberCodeData | The code data passed to the Config template callables. |
Returns void
MemberAuthMethodEmailLoginCode
Sends a login code to a member by email, using the login subject, text and HTML templates and the sender name and email from Config.
SendCode
MemberAuthMethodEmailLoginCode::SendCode(int $memberId, MemberCodeData $codeData): void
Send a login code to the member by email, building the subject, text and HTML bodies and the sender from the module's Config callables.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member to send the code to. |
$codeData | MemberCodeData | The code data passed to the Config template callables. |
Returns void
MemberAuthMethodEmailVerifyCode
Sends and resends email verification codes and completes verification: when a verify code is entered it marks the member's Email auth record as verified and runs the registered verify callbacks.
OnCodeEntered
MemberAuthMethodEmailVerifyCode::OnCodeEntered(MemberCodeData $codeData): void
Called when a verify code is entered successfully: marks the member's Email auth record as verified if it is not already, runs the registered verify callbacks, and reports the outcome.
| Name | Type | Description |
|---|---|---|
$codeData | MemberCodeData | The entered code data, identifying the member. |
Returns void
ResendCode
MemberAuthMethodEmailVerifyCode::ResendCode(MemberCodeData $codeData): MemberCodeData
Resend a verification code: creates and sends a new code when the current one has expired, otherwise resends the current code only when the resend delay has passed, throwing when it is too soon.
| Name | Type | Description |
|---|---|---|
$codeData | MemberCodeData | The current code data to resend or replace. |
Returns MemberCodeData The code that was sent, either the current code or a newly created one.
SendCode
MemberAuthMethodEmailVerifyCode::SendCode(int $memberId, MemberCodeData $codeData): void
Send a verification code to the member by email, building the subject, text and HTML bodies and the sender from the module's Config callables.
| Name | Type | Description |
|---|---|---|
$memberId | int | The member to send the code to. |
$codeData | MemberCodeData | The code data passed to the Config template callables. |
Returns void