625, // Poor mailing list quality
];
public function convert(array
$payload): AbstractMailerEvent
{ if (\
in_array($payload['event'
],
['accepted', 'rejected', 'delivered', 'failed', 'blocked'
], true
)) { $name =
match ($payload['event'
]) { 'accepted' => MailerDeliveryEvent::RECEIVED,
'rejected' => MailerDeliveryEvent::DROPPED,
'delivered' => MailerDeliveryEvent::DELIVERED,
'blocked' => MailerDeliveryEvent::DROPPED,
'failed' =>
$this->
matchFailedEvent($payload),
};
$event =
new MailerDeliveryEvent($name,
$payload['id'
],
$payload);
// reason is only available on failed messages
$event->
setReason($this->
getReason($payload));
} else { $name =
match ($payload['event'
]) { 'clicked' => MailerEngagementEvent::CLICK,
'unsubscribed' => MailerEngagementEvent::UNSUBSCRIBE,
'opened' => MailerEngagementEvent::OPEN,
'complained' => MailerEngagementEvent::SPAM,