GraffitiVerificationKit.EmailVerifier

View Categories

Preview #

About #

GraffitiVerificationKit allows you to easily add email address validation and verification to your own Xojo Web applications.

Features #

  • Email domain blocking
  • Automatic sending of verification emails via SMTP
  • Automatic validation of verification codes
  • Automatic user database table updates
  • Global rate limiting
  • Per-email or IP address rate limiting
  • Email subject, body HTML and body Text customization
  • Sender email and name customization (where supported by the SMTP server)

Installation #

  • Add the GraffitiVerificationKit module to your project
  • Setup the instance in the App.Opening event
  • Setup code link handling in the Session.Opening event
  • Implement a UI for user email and code input

Enumerations #

NameValues
EmailEncryptionsSSL
TLS

Constants #

This class exposes no constants.

Events #

This class exposes no events.

Methods #

NameParametersReturn TypeDescription
ConstructorNoneNoneCreates a new instance of the class.
VerifyCodecode as StringGraffitiVerificationKit.EmailDataAttempts to link the code to a specific user.
VerifyEmailemailAddress as String
ipAddress as String
GraffitiVerificationKit.EmailDataValidates the emailAddress then attempts to send a verification email with a generated code.

Properties #

NameTypeDefault ValueDescription
AddUserRowBooleanTrueIf True and UserDatabase properties are set, will attempt to add a new user row to the database. Otherwise will attempt to update an existing, matching user row.
BlockedDomainsString()Array( “example.com” )Email domains that are not permitted to attempt verification.
EmailAuthEnabledBooleanTrueDetermines whether EmailAuthUsername and EmailAuthPassword must be sent to the SMTP server to authenticate the user sending mail.
EmailAuthEncryptionEmailEncryptionsEmailEncryptions.SSLEncryption type required for SMTP server.
EmailAuthPasswordString“”SMTP server authorization password.
EmailAuthPortInteger465SMTP server listening port.
EmailAuthServerAddressString“”SMTP server address.
EmailAuthUsernameString“”SMTP server authorization username.
EmailBatchIntervalInteger10Number of seconds between sending email batches.
EmailBodyTemplateHTMLString<HTML String>Email body HTML code. Use %code% to replace with generated code.
EmailBodyTemplateTextString<String>Email body plain text. Use %code% to replace with generated code.
EmailSenderAddressString“”Sender email address displayed in user’s inbox.
EmailSenderNameString“”Sender name displayed in user’s inbox.
EmailSubjectString“Account Verification”Email subject line.
EnableRateLimitingBooleanTrueDetermines whether GraffitiVerificationKit will attempt to limit how often verifications are attempted.
MaximumEmailsPerBatchInteger10Determines how many emails from the queue are sent per batch.
MaximumGlobalAttemptsCountInteger500Global maximum number of attempts to allow within MaximumGlobalAttemptsPeriod.
MaximumGlobalAttemptsPeriodInteger300Length of time, in seconds, to track attempts.
MaximumUserAttemptsCountInteger5User maximum number of attempts to allow within MaximumUserAttemptsPeriod. Tracked by IP Address and Email Address.
MaximumUserAttemptsPeriodInteger300Length of time, in seconds, to track attempts.
UserDatabaseDatabaseNilReference to database for adding rows or updating verification status. It is your responsibility to ensure the database is connected, setup properly, and ready before verifications occur.
UserDatabaseCodeFieldString“”Database field to store the code for checking later. Should be a text type field with a minimum length of 20 characters.
UserDatabaseEmailFieldString“”Field in the database’s Users table where the user’s email is stored.
UserDatabaseTableNameString“”Name of the database table where user information is stored.
UserDatabaseVerifiedFieldString“”Name of the field in the users database where the verification status will be stored

Notes #

Database Tables #

It is not required that the verification data exist on your permanent users table. You may provide properties pointing to a table that is purely used for verification then check that table during your application’s login and other processes to ensure the user has verified their email address.