You are here

public function InstapageCmsPluginDrupal7Connector::mail in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/connectors/InstapageCmsPluginDrupal7Connector.php \InstapageCmsPluginDrupal7Connector::mail()

Sends an e-mail using CMS native email sending method.

Parameters

string $to Receiver address.:

string $subject A subject.:

string $message A message.:

string $headers Message headers. Default: ''.:

aray $attachments Attachments.:

Return value

bool True on success.

File

core/connectors/InstapageCmsPluginDrupal7Connector.php, line 783

Class

InstapageCmsPluginDrupal7Connector
Class that utilizes native Drupal 7 functions to perform actions like remote requests and DB operations.

Code

public function mail($to, $subject, $message, $headers = '', $attachments = array()) {
  global $language_object;
  $module = 'instapage_cms_plugin';
  $key = 'custom_email';
  $params['message'] = $message;
  $params['subject'] = $subject;
  $langcode = $language_object->language;
  $send = true;
  return drupal_mail($module, $key, $to, $langcode, $params, NULL, $send);
}