Mailcast.Webhooks (mailcast v0.0.6)

View Source

Summary

Functions

Generate a signature for a Mailcast webhook. This is useful for generating a text request to the webhook endpoint.

Verify the signature of a Mailcast webhook.

Functions

generate_signature(timestamp, raw_body, opts \\ [])

Generate a signature for a Mailcast webhook. This is useful for generating a text request to the webhook endpoint.

Parameters

  • secret - The webhook secret to use.
  • timestamp - The timestamp of the webhook.
  • raw_body - The raw body of the webhook.

verify_signature(conn, opts \\ [])

Verify the signature of a Mailcast webhook.

Options

  • :secret - The webhook secret to use. If not provided, the secret will be fetched from the :mailcast, :webhook_secret application environment. If not provided and the secret is not set in the application environment, an error will be raised.
  • :raw_body - The raw body of the webhook. If not provided, the body will be fetched from the :raw_body assign in the connection. If not provided and the body is not set in the connection, an error will be raised.