This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Mailer/SentMessage.php

72 lines
1.4 KiB
PHP
Raw Normal View History

2019-02-06 11:34:55 +00:00
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer;
use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\RawMessage;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
class SentMessage
{
private $original;
private $raw;
private $envelope;
private $debug = '';
2019-02-06 11:34:55 +00:00
/**
* @internal
*/
public function __construct(RawMessage $message, SmtpEnvelope $envelope)
{
$this->raw = $message instanceof Message ? new RawMessage($message->toIterable()) : $message;
$this->original = $message;
$this->envelope = $envelope;
}
public function getMessage(): RawMessage
{
return $this->raw;
}
public function getOriginalMessage(): RawMessage
{
return $this->original;
}
public function getEnvelope(): SmtpEnvelope
{
return $this->envelope;
}
public function getDebug(): string
{
return $this->debug;
}
public function appendDebug(string $debug): void
{
$this->debug .= $debug;
}
2019-02-06 11:34:55 +00:00
public function toString(): string
{
return $this->raw->toString();
}
public function toIterable(): iterable
{
return $this->raw->toIterable();
}
}