Rebar

Email Alerts

Receive instant email notifications when your on-chain conditions are met. Set up price alerts, governance notifications, and custom triggers in minutes.

Step 1: Register Your Email

Get a privacy-preserving email ID that connects your email to triggers without storing personal information on-chain.

Enter your email address below to receive a unique ID that you'll use in your trigger code.

Step 2: Available Email Templates

Select from pre-built email templates that format your alert data into clear, actionable notifications.

price-alert

Template ID

For crypto price notifications and threshold alerts

Required fields:
ticker - Asset symbol (e.g. "ETH")
price - Current price (number)
threshold - Trigger level (number)
condition - "above" or "below"

generic-alert

Template ID

For governance alerts, gas notifications, and custom events

Required fields:
title - Alert subject line (string)
message - Alert body content (string)

Step 3: Create Your Trigger

Deploy smart triggers that automatically monitor blockchain data and send formatted emails when your conditions are triggered.

Complete Example: ETH Price Alert

Follow this complete workflow to create a trigger that emails you when ETH crosses $3000.

How it works: Write JavaScript to deploy triggers, then use Starlark (Python-like) for the on-chain logic that processes data and determines when to send emails.

1. Install the SDK

npm install @rebar_xyz/sdk

2. Create the trigger (JavaScript)

import { RebarClient } from '@rebar_xyz/sdk';

const client = new RebarClient();

const trigger = await client.createTrigger({
  name: 'ETH Price Alert',
  description: 'Email when ETH crosses $3000',
  triggerLogicType: 'starlark',
  triggerLogic: `
# This logic runs on-chain whenever ETH price updates
eth_price = inputs[0].value
threshold = 3000.0

if eth_price > threshold:
    return {
        "emailId": "YOUR_EMAIL_ID",
        "templateId": "price-alert",
        "ticker": "ETH",
        "price": eth_price,
        "threshold": threshold,
        "condition": "above"
    }

return None  # No email if condition not met
  `,
  action: 'rebar1emailaction...',  // Pre-created by Rebar
  inputs: ['rebar1ethprice...']    // ETH price data source
});

console.log('Trigger created:', trigger.address);

3. How it works

Trigger deploys to blockchain and monitors live ETH price data
When price crosses $3000, trigger executes automatically
Formatted email delivers to your inbox within seconds
!
Note: The email action (rebar1emailaction...) is provided by Rebar. You create triggers that reference this action using your email ID and template data.

Why Email Alerts?

Privacy Protected

Your email address stays private. Only encrypted IDs are used on-chain, keeping your contact information secure.

Instant Delivery

Get notifications within seconds of your trigger conditions being met on-chain.

Reliable

99.9% delivery rate with automatic retries and delivery confirmation tracking.