Email API for Web3 Projects
Reach your users directly through their wallet email addresses. Automate notifications from smart contracts. Keep communications private with the MailBox protocol.
// Send email from your smart contract
import { MailerClient } from '@sudobility/contracts';
import { ethers } from 'ethers';
const mailer = new MailerClient(mailerAddress, signer);
// Send notification to user
await mailer.sendPriority(
userWalletAddress,
'Reward Claimed!',
`You received ${rewardAmount} tokens!`
);
Why Web3 Projects Choose MailBox
Traditional communication methods fall short in Web3. MailBox provides the missing infrastructure for direct, private, and automated user engagement.
Direct User Engagement
Connect with your users through their wallet email addresses for marketing campaigns, product announcements, and community updates. Reach them where they actually check messages.
// Marketing campaign to wallet holders
const campaign = await mailbox.createCampaign({
name: 'Token Launch Announcement',
template: 'product-launch',
targetAudience: 'token-holders',
});
const recipients = await getTokenHolders(contractAddress, {
minBalance: '1000',
});
await campaign.send({
to: recipients,
subject: 'π New Token Launch!',
data: {
tokenName: 'AWESOME',
launchDate: '2024-09-01',
bonusPercent: 15,
},
});
// Expected: 10,000+ verified recipients
// Open rate: 85% (vs 20% traditional email)
Smart Contract Integration
Automatically trigger email notifications directly from your smart contracts using the MailBox protocol. Send transaction confirmations, stake rewards, or governance notifications seamlessly.
// Solidity smart contract integration
pragma solidity ^0.8.24;
import "@sudobility/contracts/interfaces/IMailer.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract RewardDistributor {
IMailer public immutable mailer;
IERC20 public immutable usdc;
IERC20 public immutable rewardToken;
constructor(
address _mailer,
address _usdc,
address _rewardToken
) {
mailer = IMailer(_mailer);
usdc = IERC20(_usdc);
rewardToken = IERC20(_rewardToken);
}
function distributeReward(
address recipient,
uint256 amount
) external {
// Transfer reward tokens
rewardToken.transfer(recipient, amount);
// Approve USDC for email fee
usdc.approve(address(mailer), 100000);
// Send notification email
mailer.sendPriorityPrepared(
recipient,
"reward-claimed-v1"
);
emit RewardClaimed(recipient, amount);
}
}Private Communication
Keep sensitive communications off-chain and private. Unlike public blockchain messages, emails are only visible to the intended recipients, perfect for confidential business communications.
// Private business communications
const privateChannel = mailbox.createPrivateChannel({
participants: [
'0x1234...5678', // CEO wallet
'0xabcd...efgh', // CTO wallet
'0x9876...5432', // Legal team
],
encryption: 'end-to-end',
retention: '30-days',
});
await privateChannel.sendMessage({
subject: 'Q4 Strategic Planning',
body: `Confidential: Partnership proposal
with major DeFi protocol. Terms:
- $10M strategic investment
- Technical integration timeline
- Regulatory compliance review`,
attachments: ['term-sheet.pdf', 'technical-specs.pdf'],
priority: 'high',
});
Perfect for Any Web3 Project
From DeFi protocols to NFT marketplaces, MailBox helps projects across the Web3 ecosystem engage their users more effectively.
DeFi Protocols
NFT Marketplaces
DAOs
Gaming Projects
Start Integrating in Minutes
Simple 3-step integration process to get your project communicating with users via email
Install SDK
Add the MailBox SDK to your project with a simple npm install command.
Configure API
Set up your project credentials and configure the email templates you want to use.
Send Emails
Start sending emails from your smart contracts or backend with just a few lines of code.
Technical Features
Lightning Fast
Sub-second email delivery
Secure
End-to-end encryption
Analytics
Detailed delivery metrics
Multi-Chain
Works across all blockchains
Templates
Rich HTML email templates
Targeting
Segment by wallet activity
Why Choose MailBox Over Alternatives?
| Feature | MailBox | On-Chain Messages | Traditional Email | Discord/Telegram |
|---|---|---|---|---|
| Privacy | β | ~ | ||
| Smart Contract Integration | β | β | ||
| Gas Costs | Free | High | Free | Free |
| Rich Content | β | ~ | ||
| Direct to Wallet | β | β |
Explore Each Benefit in Detail
Dive deeper into how Web3 email transforms project-user communication and drives business results
Direct User Engagement
Discover marketing strategies achieving 10x better engagement rates through wallet-based email
Smart Contract Integration
Learn how to send automated email notifications directly from your smart contracts
Private Communication
See how to keep sensitive business communications private while maintaining Web3 identity