You are here

public function DevelMailLog::getFileName in Devel 7

Gets a filename for a message using tokens.

Parameters

$message: The message that will supply values for token replacement.

Return value

The full path and filename after token replacement.

1 call to DevelMailLog::getFileName()
DevelMailLog::mail in ./devel.mail.inc
Save a mail message to a file using Drupal variables and default settings.

File

./devel.mail.inc, line 60
MailSystemInterface for logging mails to the filesystem.

Class

DevelMailLog
Logs mail messages to the filesystem.

Code

public function getFileName($message) {
  $output_directory = $this
    ->getOutputDirectory();
  $this
    ->makeOutputDirectory($output_directory);
  $output_file_format = variable_get('devel_debug_mail_file_format', '%to-%subject-%datetime.mail.txt');
  $tokens = array(
    '%to' => $message['to'],
    '%subject' => $message['subject'],
    '%datetime' => date('y-m-d_his'),
  );
  return $output_directory . '/' . $this
    ->dirify(str_replace(array_keys($tokens), array_values($tokens), $output_file_format));
}