Signup

Reference for the Signup module: record an email address signup, together with its campaign, the current date and timestamp, and the request's IP address and user agent, into the signup table.

This page is a pure reference. For how the framework fits together, see the Guide.

Classes
  • SignupDatabase - record an email address signup into the signup table.

SignupDatabase

Stores signups. The single function validates the email address, then inserts a row capturing the email, an optional campaign, the current date and timestamp, and the request's IP address and user agent.

Functions

AddSignup

SignupDatabase::AddSignup(string $email, string $campaign = ""): int

Validate the email address, then insert a signup row recording the email, the campaign, the current date and timestamp, and the request's IP address and user agent.

NameTypeDescription
$emailstringThe email address to record; validated as an email address.
$campaignstringAn optional campaign name, defaulting to an empty string.

Returns int The id of the inserted signup row.