Learn
>
Alchemy x Mailchain: How to send notifications with Alchemy Notify

Alchemy x Mailchain: How to send notifications with Alchemy Notify

March 22, 2023

Why might you want to do this?

  • Notify users about new transfers to their address, e.g. creating a blockexplorer.
  • Notify about a volume of trades over a threshold, e.g. defi platform
  • Notify users about changes to their address for security purposes.

About Alchemy Notify

Alchemy's Address Activity webhook tracks all ETH, ERC20, ERC721 and ERC1155 transfers. This provides your app with real-time state changes when an address sends/receives tokens or ETH. You can specify the addresses for which you want to track this activity. A maximum of 50,000 addresses can be added to a single webhook. Alchemy have multiple webhook types available, and this tutorial would also work for: Mined transactions, Dropped transactions, NFT activity and NFT meta updates.

Solution Overview

At the end of this tutorial, we will have built a simple Express App that exposes an API to listen for ethereum address activity (e.g. ERC20, ERC721 and ERC1155 transfer events). Using the Alchemy Notify API, we will send notifications based on address activity via the Mailchain SDK to an Ethereum address.

We will be using the Alchemy Notify API quickstart. It provides easy-to-use webhook triggers based on transactions and events, and supports multiple webhook event types.

We will use the Address Activity Webhook to send a mail to an EVM address or ENS name when a transaction occurs on the address.

Final result image

The code for the webhook is based on the Authenticated webhook tutorial, which is not a prerequisite, but can be helpful to review.

Tutorial

You can find the full step-by-step tutorial here: https://docs.mailchain.com/developer/tutorials/integrations/send-mail-on-address-activity-alchemy-notify/

Alchemy Supercharged

Meet the writer

Misha Deville
Mailchain
Head of BD & Parnterships at Mailchain, Ex-AWS