@@ -8,12 +8,11 @@ The Transport class of the Notifier component allows you to optionally hook
8
8
into the lifecycle via events. Instead of reinventing
9
9
the wheel, it uses the Symfony EventDispatcher component to do the work::
10
10
11
-
12
11
The ``MessageEvent::class `` Event
13
12
--------------------------
14
13
15
14
**Typical Purposes **: Doing something before the message is send (like logging
16
- which message is going to be send) , or displaying something about the event
15
+ which message is going to be send, or displaying something about the event
17
16
to be executed.
18
17
19
18
Just before send the message, the event class ``MessageEvent `` is
@@ -26,8 +25,8 @@ dispatched. Listeners receive a
26
25
// gets the message instance
27
26
$message = $event->getMessage();
28
27
29
- // log something
30
- $this->logger(sprintf("Message with subject: %s will be send to %s, $message->getSubject(), $message->getRecipientId()"));
28
+ // log something
29
+ $this->logger(sprintf("Message with subject: %s will be send to %s, $message->getSubject(), $message->getRecipientId()"));
31
30
});
32
31
33
32
The ``FailedMessageEvent `` Event
@@ -50,8 +49,8 @@ Listeners receive a
50
49
// gets the error instance
51
50
$error = $event->getError();
52
51
53
- // log something
54
- $this->logger(sprintf("The message with subject: %s has not been sent successfully. The error is: %s, $message->getSubject(), $error->getMessage()"));
52
+ // log something
53
+ $this->logger(sprintf("The message with subject: %s has not been sent successfully. The error is: %s, $message->getSubject(), $error->getMessage()"));
55
54
});
56
55
57
56
@@ -71,6 +70,6 @@ dispatched. Listeners receive a
71
70
// gets the message instance
72
71
$message = $event->getOriginalMessage();
73
72
74
- // log something
75
- $this->logger(sprintf("The message has been successfully sent and have id: %s, $message->getMessageId()"));
73
+ // log something
74
+ $this->logger(sprintf("The message has been successfully sent and have id: %s, $message->getMessageId()"));
76
75
});
0 commit comments