Web Mailer
Powerful email marketing and campaign management platform designed to help you reach your audience effectively. Send newsletters, automated campaigns, and transactional emails at scale with advanced analytics and segmentation.
Key Features
Explore the powerful capabilities that make this solution essential for modern businesses
Email Campaigns
Create and manage professional email campaigns with drag-and-drop editor. Pre-built templates and custom design options for your brand.
Automation Workflows
Set up automated email sequences based on user behavior and triggers. Welcome series, re-engagement campaigns, and drip campaigns.
List Segmentation
Divide your audience into segments based on demographics, behavior, and engagement. Send targeted messages to the right people at the right time.
Advanced Analytics
Detailed insights into open rates, click rates, and conversions. Identify top performers and optimize future campaigns.
A/B Testing
Test different subject lines, content, and send times. Data-driven optimization to maximize engagement and ROI.
Template Library
Access to hundreds of professionally designed email templates. Customizable layouts for every industry and use case.
Why Choose Our Solution
Discover the advantages that set our approach apart in the industry
Increase email open rates and click-through rates with targeted campaigns
Save time with automation workflows and email sequences
Build stronger customer relationships with personalized messaging
Measure ROI with comprehensive analytics and reporting
Scale your email marketing as your business grows
Maintain high deliverability rates with our secure infrastructure
Integrate with NPM Package
Use the ddw-mail-js NPM package to seamlessly integrate Web Mailer into your applications. Send emails from any website or application on behalf of your users.
Installation
npm install ddw-mail-jsOr with yarn: yarn add ddw-mail-js
Quick Start
import DirectDigitalMailer from "ddw-mail-js";
// Initialize with your API key
DirectDigitalMailer.init("your-api-key");
// Send an email
const response = await DirectDigitalMailer.send(
"service-id",
"template-id",
["recipient@example.com"],
{ name: "John", subject: "Welcome" }
);
console.log("Email sent:", response.status);Getting Your API Key
- Visit the Dashboard: https://mailer.directdigitalworld.com
- Create an Account: Sign up with your email and password
- Navigate to Profile Settings: Log in and click your profile icon (top right)
- Copy Your API Key: Look for the "API Key" section and copy it
- Keep it Secure: Treat your API key like a password - never share it
Usage Examples
Basic Email Send
const response = await DirectDigitalMailer.send(
"service-123", // serviceId
"template-456", // templateId
["user@example.com"], // recipients array
{ // variables (optional)
name: "John",
subject: "Welcome to our service",
confirmationLink: "https://example.com/confirm?token=abc123"
}
);
console.log("Status:", response.status);Multiple Recipients
const recipients = [
"user1@example.com",
"user2@example.com",
"user3@example.com",
];
const response = await DirectDigitalMailer.send(
"service-id",
"template-id",
recipients,
{ subject: "Bulk email" }
);React Component Example
import { useState } from "react";
import DirectDigitalMailer from "ddw-mail-js";
export function NewsletterSignup() {
const [email, setEmail] = useState("");
const [status, setStatus] = useState("idle");
React.useEffect(() => {
DirectDigitalMailer.init(process.env.REACT_APP_DDW_MAIL_API_KEY);
}, []);
const handleSubmit = async (e) => {
e.preventDefault();
setStatus("loading");
try {
await DirectDigitalMailer.send(
"newsletter-service",
"welcome-email",
[email],
{ email, timestamp: new Date().toISOString() }
);
setStatus("success");
alert("Welcome email sent!");
setEmail("");
} catch (error) {
setStatus("error");
alert("Failed to send email");
}
};
return (
<form onSubmit={handleSubmit}>
<input
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="Enter your email"
required
/>
<button type="submit" disabled={status === "loading"}>
{status === "loading" ? "Signing up..." : "Sign Up"}
</button>
</form>
);
}Node.js Express Backend Example
import express from "express";
import DirectDigitalMailer from "ddw-mail-js";
import dotenv from "dotenv";
dotenv.config();
const app = express();
app.use(express.json());
// Initialize on server startup
DirectDigitalMailer.init(process.env.DDW_MAIL_API_KEY);
// Send welcome email on registration
app.post("/api/users/register", async (req, res) => {
try {
const { email, name } = req.body;
const response = await DirectDigitalMailer.send(
"user-service",
"registration-welcome",
[email],
{
name,
email,
activationLink: `https://example.com/activate?email=${email}`,
}
);
res.json({
success: true,
message: "Registration email sent",
status: response.status,
});
} catch (error) {
res.status(500).json({
error: "Failed to send registration email",
details: error.message,
});
}
});
// Send password reset email
app.post("/api/password-reset", async (req, res) => {
try {
const { email, resetToken } = req.body;
await DirectDigitalMailer.send(
"user-service",
"password-reset",
[email],
{
email,
resetLink: `https://example.com/reset?token=${resetToken}`,
expiresIn: "1 hour",
}
);
res.json({ success: true });
} catch (error) {
res.status(500).json({ error: "Failed to send reset email" });
}
});
app.listen(3000, () => {
console.log("Server running on port 3000");
console.log("DDW Mail JS initialized");
});HTML Form Integration
<!-- HTML Form -->
<form id="contactForm">
<input type="text" name="name" placeholder="Your name" required />
<input type="email" name="email" placeholder="Your email" required />
<textarea name="message" placeholder="Your message" required></textarea>
<button type="submit">Send</button>
</form>
<!-- JavaScript -->
<script>
DirectDigitalMailer.init("your-api-key");
document.getElementById("contactForm").addEventListener("submit", async (e) => {
e.preventDefault();
try {
const response = await DirectDigitalMailer.sendForm(
"service-id",
"contact-template",
["admin@example.com"],
"contactForm"
);
console.log("Email sent:", response.status);
alert("Message sent!");
} catch (error) {
alert("Failed to send message");
}
});
</script>API Reference
init(apiKey: string)
Initializes the DirectDigitalMailer client with your API key.
send(serviceId, templateId, recipients, variables?)
Sends an email using a template.
serviceId- Your service ID from the dashboardtemplateId- The email template IDrecipients- Array of recipient email addressesvariables- Template variables to populate the email (optional)
sendForm(serviceId, templateId, recipients, form)
Sends an email with form data as variables.
form- Form element or form ID
Best Practices
- Protect Your API Key: Use environment variables, never hardcode. Use different keys for development and production.
- Initialize Early: Call init() as soon as possible in your application lifecycle.
- Use Backend Proxies: For browser applications, call your backend API instead of exposing the API key.
- Validate Input: Always validate service IDs, template IDs, and email addresses before sending.
- Handle Errors: Always wrap send() calls in try-catch blocks and handle failures gracefully.
- Log Information: Keep logs of sent emails for debugging and monitoring purposes.
- Use TypeScript: The package includes full TypeScript support for type-safe code.
- Test First: Use test service/template IDs before going to production.
Security Tips
✅ DO:
- Use environment variables for API keys
- Keep API keys in backend code only
- Use HTTPS for all API calls
- Rotate API keys regularly from the dashboard
- Use different keys for each environment
❌ DON'T:
- Hardcode API keys in source code
- Commit .env files to version control
- Expose API keys in browser code
- Share API keys via email or chat
- Use the same key across multiple environments
Support & Resources
- Dashboard: https://mailer.directdigitalworld.com
- NPM Package: https://www.npmjs.com/package/ddw-mail-js
- Documentation: Full API documentation available on NPM
- Support: Contact our support team through the dashboard