Skip to content

Commit

Permalink
Fixes SES inbound notifications (#140)
Browse files Browse the repository at this point in the history
SES oddly capitalizes certain fields for no apparent reason, this lowercases their header keys so we can appropriately match against them. This was preventing bounces, etc from being reported correctly
  • Loading branch information
pushchris authored Apr 22, 2023
1 parent 80773c1 commit 4813cce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/platform/src/providers/email/SESEmailProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default class SESEmailProvider extends EmailProvider {
const getHeader = (
headers: Array<{ name: string, value: string }>,
key: string,
) => (headers ?? []).find((item) => item.name === key)?.value
) => (headers ?? []).find((item) => item.name.toLowerCase() === key.toLowerCase())?.value

const json = JSON.parse(message) as Record<string, any>
const { notificationType, mail: { destination, headers } } = json
Expand Down

0 comments on commit 4813cce

Please sign in to comment.