Commit eec2802b authored by renatog's avatar renatog Committed by Renato Goncalves de Araujo
Browse files

Issue #2935958 by RenatoG, erickbj: Create generic log for emails

parent bc010c96
Loading
Loading
Loading
Loading
+4 −9
Changes for forms_to_email.module: 4 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -271,15 +271,10 @@ function forms_to_email_send_form_to_email($data) {

  $mail_sended = mail($to, $subject, $body, $headers);

  if ($mail_sended) {
    watchdog('forms_to_email', '<pre>E-mail has been sent.@break_line Headers: @headers @break_line To: @to @break_line Subject: @subject @break_line Body: @body</pre>', array(
      '@break_line' => PHP_EOL,
      '@headers' => $headers,
      '@to' => $to,
      '@subject' => $subject,
      '@body' => $body,
    ), WATCHDOG_INFO);
  }
  $message = (!empty($mail_sended)) ? t('E-mail has been sent') : t('Error on trying to send email');

  // Log result.
  watchdog('forms_to_email', $message, array(), WATCHDOG_INFO);

  return $mail_sended;
}