function DevelMailLog::mail

Same name in other branches
  1. 4.x src/Plugin/Mail/DevelMailLog.php \Drupal\devel\Plugin\Mail\DevelMailLog::mail()
  2. 5.x src/Plugin/Mail/DevelMailLog.php \Drupal\devel\Plugin\Mail\DevelMailLog::mail()

Save a mail message to a file using Drupal variables and default settings.

Parameters

$message: A message array, as described in hook_mail_alter().

Return value

TRUE if the mail was successfully accepted, otherwise FALSE.

Overrides DefaultMailSystem::mail

See also

http://php.net/manual/en/function.mail.php

drupal_mail()

File

./devel.mail.inc, line 94

Class

DevelMailLog
Logs mail messages to the filesystem.

Code

public function mail(array $message) {
    $output = $this->composeMessage($message);
    $output_file = $this->getFileName($message);
    return file_put_contents($output_file, $output);
}