function _mass_contact_finalize_headers in Mass Contact 7
Finalizes the headers, by setting the To, Subject, and possibly, Bcc fields.
Parameters
bool $bcc: Indicates whether the recipients are to be put into the To or Bcc field. TRUE indicates the Bcc field, and FALSE indicates the To field.
string $recipients: The list of recipients, separated by a comma.
array &$params: The message array.
string $from_email: The message sender's email address.
string $subject: The subject of the message.
Return value
string The contents of the To field. If $bcc is TRUE, this will be $from_email. If it is FALSE, it will be $recipients.
1 call to _mass_contact_finalize_headers()
- mass_contact_mail_page_submit in ./
mass_contact.page.inc - Processes the main Mass Contact mail form.
File
- ./
mass_contact.page.inc, line 1216 - The main form for creating and sending the messages.
Code
function _mass_contact_finalize_headers($bcc, $recipients, array &$params, $from_email, $subject) {
// If blind carbon copy (BCC) was selected, put the recipients in
// the Bcc field.
if ($bcc) {
$params['headers']['Bcc'] = $recipients;
$to = $from_email;
}
else {
// Else, put the recipients in the To field.
$to = $recipients;
}
$params['subject'] = $subject;
return $to;
}