Project Benefit #2

Send Emails DirectlyFrom Smart Contracts

Automate user notifications with smart contract integration. Send transaction confirmations, reward alerts, and governance notifications without any backend infrastructure.

πŸ“œ

Zero Backend, Maximum Automation

5K
Gas Overhead
<3s
Delivery Time
6
Blockchains
∞
Scale
YourContract.sol
function claimRewards() external {
    uint256 rewards = calculateRewards(msg.sender);
    _transfer(rewardToken, msg.sender, rewards);

    // Approve USDC for email fee
    usdc.approve(address(mailer), mailer.getFee());

    // Send email notification using prepared template
    mailer.sendPrepared(
        msg.sender,
        "reward-notification",  // template ID
        false,                  // standard mode: 10% fee only
        true                    // resolve sender name
    );
}

Three Powerful Integration Types

Automate critical user communications directly from your smart contracts

Transaction Notifications

Real-time notificationsImproved user experienceReduced support tickets

Automatically notify users about successful transactions, failed attempts, and pending confirmations.

Common Use Cases:

  • DeFi swap confirmations with slippage details
  • NFT purchase receipts with marketplace links
  • Staking rewards claimed notifications
  • Failed transaction alerts with gas estimation
  • Cross-chain bridge completion updates
Implementation Example
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IMailer {
    function sendPrepared(
        address to,
        string calldata mailId,
        bool revenueShareToReceiver,
        bool resolveSenderToName
    ) external;
}

// Send email on successful swap
event SwapCompleted(address user, uint256 amountIn, uint256 amountOut);

function swap(uint256 amountIn) external {
    // ... swap logic ...

    emit SwapCompleted(msg.sender, amountIn, amountOut);

    // Approve USDC for email fee (adjust based on fee structure)
    usdc.approve(address(mailer), 10000); // 0.01 USDC for standard mode

    // Trigger email notification using template
    IMailer(mailerContract).sendPrepared(
        msg.sender,
        "swap-confirmation",  // template ID
        false,                // standard mode: 10% fee only
        true                  // resolve sender name
    );
}

DeFi Protocol Events

Prevent liquidationsIncrease protocol TVLBetter user retention

Keep users informed about yield farming rewards, liquidation risks, and protocol changes.

Common Use Cases:

  • Yield farming reward distributions
  • Liquidation warnings at 110% collateral ratio
  • New pool launches with bonus APY
  • Governance proposal voting reminders
  • Protocol fee changes and updates
Implementation Example
// Monitor health factor and warn users
function checkHealthFactor(address user) external {
    uint256 healthFactor = calculateHealthFactor(user);
    
    if (healthFactor < 1.2e18) { // Below 120%
        IMailBox(mailboxContract).sendEmail(
            user,
            "⚠️ Liquidation Risk Alert",
            "liquidation-warning",
            abi.encode(healthFactor, requiredCollateral)
        );
    }
}

Governance & DAO

Higher voting participationTransparent governanceActive community

Automate governance communications and voting notifications for your DAO members.

Common Use Cases:

  • New proposal creation announcements
  • Voting deadline reminders (24h, 1h before)
  • Proposal execution confirmations
  • Delegation change notifications
  • Treasury milestone updates
Implementation Example
// Notify on new governance proposal
function createProposal(string calldata description) external {
    uint256 proposalId = proposals.length;
    
    // ... create proposal logic ...
    
    // Email all token holders
    IMailBox(mailboxContract).sendBulkEmail(
        getAllTokenHolders(),
        "πŸ—³οΈ New Governance Proposal",
        "governance-proposal",
        abi.encode(proposalId, description, block.timestamp + votingDelay)
    );
}

Built for Production

Enterprise-grade features that scale with your protocol

Gas Optimized

Minimal gas overhead - typically <5,000 gas per email

Optimized contract calls that don't impact your main transaction costs

Instant Delivery

Emails sent within seconds of transaction confirmation

Real-time processing with <3 second average delivery time

Template System

Pre-built templates for common use cases

Customizable HTML/text templates with dynamic data injection

Analytics Dashboard

Track email delivery and engagement metrics

Real-time analytics on open rates, clicks, and conversions

Multi-Chain Support

Deploy on any blockchain - we handle the complexity

πŸ”΅

Ethereum

Live
Gas Cost:~4,200 gas

Available Networks:

Mainnet
πŸ”΅

Ethereum sepolia

Beta
Gas Cost:~3,000 gas

Available Networks:

Mainnet

Integration in 3 Simple Steps

Get started with smart contract email integration in under 10 minutes

1

Install the SDK

~2 minutes

Add MailBox to your smart contract project

install-sdk.sh
npm install @sudobility/contracts
# or
yarn add @sudobility/contracts
# or
pnpm add @sudobility/contracts
2

Import Interface

~1 minute

Import the IMailBox interface in your contract

import-interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "@sudobility/contracts/interfaces/IMailer.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract YourContract {
    IMailer constant mailer = IMailer(0x...); // Mailer contract address
    IERC20 constant usdc = IERC20(0x...);     // USDC token address
}
3

Send Emails

~5 minutes

Call the sendEmail function from your contract logic

send-emails.sol
function notifyUser(address recipient) external {
    // Approve USDC spending first (0.1 USDC for priority, 0.01 USDC for standard)
    usdc.approve(address(mailer), 100000);

    // Send priority email (recipient gets 90% fee back as claimable)
    mailer.send(
        recipient,                    // recipient address
        "Transaction Complete",       // email subject
        "Your transaction was successful!", // email body
        true,                         // revenueShareToReceiver: true = priority (90% share)
        true                          // resolveSenderToName: resolve to ENS/SNS
    );

    // Or send standard email (10% fee only, no revenue share)
    mailer.send(
        recipient,
        "Update Available",
        "A new version is ready",
        false,                        // revenueShareToReceiver: false = standard (10% fee only)
        true                          // resolveSenderToName
    );

    // Or use prepared template (priority with revenue share)
    mailer.sendPrepared(
        recipient,
        "tx-success-v1",              // template ID
        true,                         // priority mode with revenue share
        true                          // resolve sender name
    );
}

Advanced Features

Powerful capabilities for complex use cases

Conditional Logic

Send emails based on complex on-chain conditions

Example:
Only notify users if their position size exceeds $1,000 and health factor drops below 150%

Bulk Operations

Email multiple users in a single transaction

Example:
Notify all LP providers when a new incentive program launches

Template Variables

Dynamic content based on transaction data

Example:
Include swap amounts, fees, slippage, and transaction hash in confirmations

Retry Logic

Automatic retry for failed email deliveries

Example:
Retry important notifications up to 3 times with exponential backoff

Success Stories

How protocols transformed their user experience with smart contract emails

DeFi Yield Protocol

Integration:

Automated reward notifications + liquidation warnings

-67%
liquidations
+145%
user Retention
-80%
support Tickets
"Smart contract emails reduced our liquidation events by 67%. Users now get timely warnings and can act before it's too late."
NFT Marketplace

Integration:

Bid notifications + sale confirmations

+234%
bid Activity
+156%
sales Volume
+89%
return Buyers
"Automated bid notifications transformed our marketplace. Sellers respond faster and buyers stay engaged throughout auctions."
Gaming Protocol

Integration:

Achievement unlocks + reward distributions

+178%
daily Active
+267%
quest Completion
+145%
token Earnings
"Players love getting instant notifications when they unlock achievements. It's gamification taken to the next level."

Start Building Smart Contract Emails

Join protocols automating user communications with smart contract email integration. Reduce development time and improve user experience.

πŸš€Performance Monitor

Web Vitals

LCPLargest Contentful Paint
2928ms
FIDFirst Input Delay
N/Ams
CLSCumulative Layout Shift
0.060
FCPFirst Contentful Paint
2156ms
TTFBTime to First Byte
126ms

Bundle Performance

JS Load
19444ms
CSS Load
859ms
JS Files
166
Transfer Size
23.3MB

API Calls

Count
2
Total Time
131ms
Avg Time
66ms
Slowest
69ms

Memory

Used Heap
73.1MB
Total Heap
82.4MB
Usage
2%
GoodNeeds ImprovementPoor