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.

Classes

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.

Functions

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.

NameTypeDescription
$memberIdintThe member to send the code to.
$codeDataMemberCodeDataThe 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.

Functions

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.

NameTypeDescription
$memberIdintThe member to send the code to.
$codeDataMemberCodeDataThe 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.

NameTypeDescription
$codeDataMemberCodeDataThe 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.

NameTypeDescription
$codeDataMemberCodeDataThe 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.

NameTypeDescription
$memberIdintThe member to send the code to.
$codeDataMemberCodeDataThe code data passed to the Config template callables.

Returns void