You are here

function _views_send_format_address in Views Send 7

Same name and namespace in other branches
  1. 8 views_send.module \_views_send_format_address()
  2. 6 views_send.module \_views_send_format_address()

Build a formatted e-mail address.

2 calls to _views_send_format_address()
views_send_confirm_form in ./views_send.module
Multistep form callback for the "confirm" step. Allows the user to preview the whole message before sending it.
_views_send_prepare_mail in ./views_send.module
Prepare the mail message before sending or spooling.

File

./views_send.module, line 1025
The Views Send module.

Code

function _views_send_format_address($mail, $name, $encode = TRUE) {

  // Do not format addres on Windows based PHP systems or when $name is empty.
  if (substr(PHP_OS, 0, 3) == 'WIN' || empty($name)) {
    return $mail;
  }
  else {
    $name = $encode ? _views_send_mime_header_encode($name) : $name;
    return sprintf('"%s" <%s>', $name, $mail);
  }
}