/**
  * @param OutboundMessage $message
  * @param ReplyableMessage $parentMessage
  */
 public function modifyToReplyMessage(OutboundMessage $message, ReplyableMessage $parentMessage)
 {
     $references = $parentMessage->getReferences() . ' ' . $parentMessage->getMessageId();
     $message->setReferences($references);
     $message->setInReplyTo($parentMessage->getMessageId());
     $message->setSubject(static::SUBJECT_PREFIX . $parentMessage->getSubject());
 }
 /**
  * @param OutboundMessage $message
  * @return array
  */
 protected function getRawRecipients(OutboundMessage $message)
 {
     return array_map(function (Recipient $recipient) {
         return ['email' => $recipient->getEmail(), 'name' => $recipient->getName(), 'type' => $recipient->getType()];
     }, $message->getRecipients());
 }
 /**
  * @param OutboundMessage $message
  */
 public function transform(OutboundMessage $message)
 {
     if ($this->enforcedDeliveryAddress !== null) {
         $message->setRecipients([new ToRecipient($this->enforcedDeliveryAddress)]);
     }
 }