Working with Email and Phone

When capturing emails and phone numbers from users it is important to ensure the information is indeed valid so that it can be used to send outgoing messages. Attempting to send emails to non-existent email addresses, and calling or sending text messages to invalid phone numbers can adversely affect spam scores. The ISEMAIL function will return TRUE when provided a string that appears to be a valid email address. The ISPHONE function will return TRUE when provided a string that appears to be an E-164 formatted phone number.

While the properly formatted E-164 phone number stored on the Actor is needed to ensure when interacting with the user over Voice or SMS, users are used to seeing phone numbers formatted in different ways depending on their locale. The FORMAT_PHONE function will display an E-164 string in various formats.

FORMAT_PHONE("+15558675309", "NATIONAL") => "(555) 867-5309"

Relevant Functions