You are here

function sendgrid_integration_parse_address in SendGrid Integration 7

Split an email address into it's name and address components.

1 call to sendgrid_integration_parse_address()
SendGridMailSystem::mail in inc/sendgrid.mail.inc
Implement mail method to send mail via Sendgrid.

File

./sendgrid_integration.module, line 186
Main module file for SendGrid Integration.

Code

function sendgrid_integration_parse_address($email) {
  if (preg_match(SENDGRID_INTEGRATION_EMAIL_REGEX, $email, $matches)) {
    return [
      $matches[2],
      $matches[1],
    ];
  }
  else {
    return [
      $email,
      ' ',
    ];
  }
}