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
stringThe 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
stringThe 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
stringThe 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
stringThe username.
Returns
IsSupportedUserName(string)
Determines whether a username doesn't have unsupported characters.
public static bool IsSupportedUserName(string username)
Parameters
username
stringThe username.
Returns
IsValidEmailAddress(string?)
Determines whether an email address is valid.
public static bool IsValidEmailAddress(string? email)
Parameters
email
stringThe email.
Returns
IsValidUserName(string?)
Determines whether an username is valid.
public static bool IsValidUserName(string? username)
Parameters
username
stringThe username.
Returns
SynthesizeEmail(string, string)
Synthesizes an email from the domain and login.
public static string SynthesizeEmail(string domain, string login)
Parameters
Returns
- string
The synthesized email address.