Skip to content

Conversation

marconneves
Copy link

This new webhook system allows you to receive notifications about events that happen in your account. You can use webhooks to integrate with third-party services, such as a CRM, a marketing automation platform, or a custom
application.

How to create a webhook

  1. Go to the Developer settings page and click on the Webhooks tab.
  2. Click on the Add Webhook button.
  3. Enter the URL of the endpoint that will receive the webhook notifications.
  4. Select the events that you want to be notified about.
  5. Click on the Create button.

How it works

When an event occurs in your account, such as when an email is sent or a domain is verified, we will send a POST request to the URL that you specified. The body of the request will be a JSON object with the following format:

    {
      "event": "EVENT_NAME",
      "payload": {
        ...
      }
    }

The event property will be the name of the event that occurred, and the payload property will be an object containing the data related to the event.

Caching

To improve performance and reduce the number of database queries, we cache the webhook configurations for 10 minutes. This means that when an event occurs, we will first check if we have the webhook configurations in the cache. If
we do, we will use the cached data to send the webhook notifications. If we don't, we will fetch the data from the database and store it in the cache for future use.

@KMKoushik
Copy link
Member

@marconneves this is so cool, i'll try to review this over the weekend!

@KMKoushik
Copy link
Member

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Function Returns Incorrect Type

The toWebhookEvent function returns string literals (e.g., "EMAIL_SENT") instead of WebhookEvent enum values. This leads to a type mismatch when passed to WebhookService.triggerWebhook, which expects a WebhookEvent type. The function should return WebhookEvent enum values.

apps/web/src/server/service/ses-hook-parser.ts#L191-L209

https://github.com/unsend-dev/unsend/blob/c4cf94038edb50180c06660f581c3327dac1f28d/apps/web/src/server/service/ses-hook-parser.ts#L191-L209

apps/web/src/server/service/ses-hook-parser.ts#L178-L179

https://github.com/unsend-dev/unsend/blob/c4cf94038edb50180c06660f581c3327dac1f28d/apps/web/src/server/service/ses-hook-parser.ts#L178-L179

Fix in CursorFix in Web


BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

@KMKoushik
Copy link
Member

@marconneves lemme know if get some time on addressing bugbot comments

@enemyrr
Copy link
Contributor

enemyrr commented Aug 22, 2025

0001-fix-return-WebhookEvent-enum-values-instead-of-strin.patch

git apply 0001-fix-return-WebhookEvent-enum-values-instead-of-strin.patch

@enemyrr
Copy link
Contributor

enemyrr commented Sep 10, 2025

@marconneves would be really cool to have it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants