You are here

public static function Conversion::swiftmailer_add_path_header in Swift Mailer 8

Same name and namespace in other branches
  1. 8.2 src/Utility/Conversion.php \Drupal\swiftmailer\Utility\Conversion::swiftmailer_add_path_header()

Adds a path header to a message.

Parameters

\Swift_Message $message: The message which the path header is to be added to.

string $key: The header key.

string $value: The header value.

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

File

src/Utility/Conversion.php, line 330

Class

Conversion
@todo

Namespace

Drupal\swiftmailer\Utility

Code

public static function swiftmailer_add_path_header(Swift_Message $message, $key, $value) {

  // Remove any already existing header identified by the provided key.
  static::swiftmailer_remove_header($message, $key);

  // Add the header.
  $message
    ->getHeaders()
    ->addPathHeader($key, $value);
}