Threshold Email
OpenMeter Notifications enables you to send usage threshold emails to your team and customers.
Configuring Notification
To send usage threshold email notifications, you need to setup Notifications. Check the Notifications guide to learn how to set up Notifications.
Configure your webhook on the OpenMeter Cloud UI with the desired interval and
query period. For example, to send daily usage threshold email notifications
about current month usage, you can set the interval
to daily
and period
to
CURRENT_MONTH
.
Sending Threshold Email
To send out emails when a customer reaches the defined threshold, we are listening on the OpenMeter Notificaiton webhooks. When we receive the webhook we use Resend to send out email notifications. Resend is a transactional email service that allows you to send emails using a simple API and React.
Let's see the following Next.js example that consumes webhooks and sends out emails.