@mxraven/mail - v0.2.0
    Preparing search index...

    Function decode

    • Decodes a webhook payload.

      Dispatching is based on the payload's event_type field. SMTP delivery statuses do not carry an event_type, so a body with a status field and no recognized event type is decoded as a delivery status.

      Parameters

      • body: string | Uint8Array<ArrayBufferLike>

        The raw JSON payload bytes, or a decoded string.

      Returns Event

      The decoded event.

      Error When the body is not valid JSON or the payload is unrecognized.