You are here

public static function Conversion::swiftmailer_add_mailbox_header in Swift Mailer 8.2

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

Adds a mailbox header to a message.

Parameters

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

string $key: The header key.

string $value: The header value.

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

File

src/Utility/Conversion.php, line 234

Class

Conversion
@todo

Namespace

Drupal\swiftmailer\Utility

Code

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

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

  // Parse mailboxes.
  $mailboxes = static::swiftmailer_parse_mailboxes($value);

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