Skip to content

Commit

Permalink
Merge pull request #21 from emchooo/fix-event-type
Browse files Browse the repository at this point in the history
[fix] Add check for eventType or notificationType in AWS SES handler
  • Loading branch information
rennokki authored Oct 13, 2021
2 parents 8ef0830 + a74eb80 commit 2c3979e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Http/Controllers/SesWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ protected function onNotification(array $snsMessage, Request $request): void
{
$decodedMessage = json_decode($snsMessage['Message'], true);

$eventType = $decodedMessage['eventType'] ?? null;
$typeKey = array_key_exists('eventType', $decodedMessage) ? 'eventType' : 'notificationType';
$eventType = $decodedMessage[$typeKey] ?? null;

$methodToCall = 'on'.Str::studly($eventType);

Expand Down

0 comments on commit 2c3979e

Please sign in to comment.