{ throw new RejectWebhookException(406, 'Payload is malformed.'
);
} if ($secret) { if (!
$request->headers->
get('X-Twilio-Email-Event-Webhook-Signature'
) || !
$request->headers->
get('X-Twilio-Email-Event-Webhook-Timestamp'
) ) { throw new RejectWebhookException(406, 'Signature is required.'
);
} $this->
validateSignature( $request->headers->
get('X-Twilio-Email-Event-Webhook-Signature'
),
$request->headers->
get('X-Twilio-Email-Event-Webhook-Timestamp'
),
$request->
getContent(),
$secret,
);
} try { return $this->converter->
convert($content[0
]);
} catch (ParseException
$e) { throw new RejectWebhookException(406,
$e->
getMessage(),
$e);
}