Change Message sent text to Message spooled if we are in a spool context
This commit is contained in:
parent
a505ff43b5
commit
f8dead7782
@ -24,12 +24,12 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
class MessageDataCollector extends DataCollector
|
||||
{
|
||||
protected $logger;
|
||||
protected $mailer;
|
||||
|
||||
public function __construct(\Swift_Events_SendListener $logger, \Swift_Mailer $mailer)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
// we do nothing with the mailer
|
||||
// it's in the constructor just to force SwiftMailer to be initialized
|
||||
$this->mailer = $mailer;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -39,6 +39,7 @@ class MessageDataCollector extends DataCollector
|
||||
{
|
||||
$this->data['messages'] = $this->logger->getMessages();
|
||||
$this->data['messageCount'] = $this->logger->countMessages();
|
||||
$this->data['isSpool'] = $this->mailer->getTransport() instanceof \Swift_Transport_SpoolTransport;
|
||||
}
|
||||
|
||||
public function getMessageCount()
|
||||
@ -51,6 +52,11 @@ class MessageDataCollector extends DataCollector
|
||||
return $this->data['messages'];
|
||||
}
|
||||
|
||||
public function isSpool()
|
||||
{
|
||||
return $this->data['isSpool'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -23,7 +23,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
<h2>Messages sent</h2>
|
||||
<h2>Messages {% if not collector.isSpool %} sent {% else %} spooled {% endif %}</h2>
|
||||
|
||||
{% if not collector.messages %}
|
||||
<p>
|
||||
|
Reference in New Issue
Block a user