You are here

protected static function HtmlMailMime::successful in HTML Mail 8.3

Same name and namespace in other branches
  1. 8 src/Utility/HTMLMailMime.php \Drupal\htmlmail\Utility\HTMLMailMime::successful()

Routes \PEAR_Error objects to logger.

Passes \PEAR_Error objects to logger, and returns FALSE.

Parameters

object $data: The result of another function that may return a \PEAR_Error object.

Return value

bool|object FALSE if $data is a \PEAR_Error object; otherwise $data.

9 calls to HtmlMailMime::successful()
HtmlMailMime::addAttachment in src/Utility/HtmlMailMime.php
Adds a file to the list of attachments.
HtmlMailMime::addHtmlImage in src/Utility/HtmlMailMime.php
Adds an image to the list of embedded images.
HtmlMailMime::get in src/Utility/HtmlMailMime.php
Builds and returns the full multipart message with all its parts.
HtmlMailMime::getMessage in src/Utility/HtmlMailMime.php
Returns the complete email, ready to send.
HtmlMailMime::parse in src/Utility/HtmlMailMime.php
Parse a complete message and return a HtmlMailMime object.

... See full list

File

src/Utility/HtmlMailMime.php, line 133

Class

HtmlMailMime
Class HtmlMailMime.

Namespace

Drupal\htmlmail\Utility

Code

protected static function &successful(&$data) {
  if (\PEAR::isError($data)) {
    self::getLogger()
      ->error('<a href=":pear_error">PEAR error: @error</a>', [
      ':pear_error' => 'http://pear.php.net/manual/core.pear.pear.iserror.php',
      '@error' => $data
        ->toString(),
    ]);
    $data = FALSE;
  }
  return $data;
}