You are here

function swiftmailer_is_multipart in Swift Mailer 8

Same name and namespace in other branches
  1. 8.2 includes/helpers/utilities.inc \swiftmailer_is_multipart()
  2. 7 includes/helpers/utilities.inc \swiftmailer_is_multipart()

Validates whether a message is multipart or not.

Parameters

array $message: The message which is to be validatet.

Return value

bool A boolean indicating whether the message is multipart or not.

1 call to swiftmailer_is_multipart()
SwiftMailer::mail in src/Plugin/Mail/SwiftMailer.php
Sends a message composed by drupal_mail().

File

includes/helpers/utilities.inc, line 134
This file contains general utility functions.

Code

function swiftmailer_is_multipart(&$message) {
  $parts = 0;
  if (!empty($message['body'])) {
    $parts++;
  }
  if (!empty($message['plain'])) {
    $parts++;
  }
  if (!empty($message['params']['files'])) {
    $parts++;
  }
  if (!empty($message['params']['images'])) {
    $parts++;
  }
  return $parts > 1 ? TRUE : FALSE;
}