Table of Contents

Class EmailHelper

Namespace
Geotab.Checkmate.ObjectModel
Assembly
Geotab.Checkmate.ObjectModel.dll

A helper class for validating users emails and creating emails.

public static class EmailHelper
Inheritance
EmailHelper
Inherited Members

Methods

CleanEmail(string?)

Cleans an email address.

public static string? CleanEmail(string? dirtyEmail)

Parameters

dirtyEmail string

The dirty email address.

Returns

string

The cleaned email address.

GetDomainFromEmail(string?)

Get the domain from an email address.

public static string GetDomainFromEmail(string? email)

Parameters

email string

The email.

Returns

string

The domain.

Exceptions

ArgumentException

Throws if email is invalid.

IsEmailAddress(string?)

Determines whether a string is an email address.

public static bool IsEmailAddress(string? email)

Parameters

email string

The email.

Returns

bool

True if the string is an email address.

IsRestrictedUserName(string)

Determines whether an username is restricted and shouldn't be allowed

public static bool IsRestrictedUserName(string username)

Parameters

username string

The username.

Returns

bool

true if the username is restricted; otherwise, false.

IsSupportedUserName(string)

Determines whether a username doesn't have unsupported characters.

public static bool IsSupportedUserName(string username)

Parameters

username string

The username.

Returns

bool

true if the username is valid and has an unsupported character; otherwise, false.

IsValidEmailAddress(string?)

Determines whether an email address is valid.

public static bool IsValidEmailAddress(string? email)

Parameters

email string

The email.

Returns

bool

true if the email is valid; otherwise, false.

IsValidUserName(string?)

Determines whether an username is valid.

public static bool IsValidUserName(string? username)

Parameters

username string

The username.

Returns

bool

true if the username is valid; otherwise, false.

SynthesizeEmail(string, string)

Synthesizes an email from the domain and login.

public static string SynthesizeEmail(string domain, string login)

Parameters

domain string

The domain.

login string

The login.

Returns

string

The synthesized email address.