Multi-tenant invoicing platform uses Sendmator to deliver 60,000+ invoices monthly via email, SMS, and WhatsApp with 99.9% delivery rates and automated payment reminders.
Billmator is a multi-tenant SaaS invoicing platform built with NestJS and PostgreSQL that helps businesses create, manage, and track invoices with professional templates, payment tracking, and automated workflows.
Each invoice had to be manually emailed to customers. With 60,000+ invoices monthly across 1,000+ businesses, this was completely unscalable.
No automated system to remind customers about overdue invoices. Businesses had to manually chase payments, leading to cash flow issues.
Only email delivery. No SMS or WhatsApp support for urgent payment notifications or customers who prefer messaging apps.
Impossible to know if invoices were delivered, opened, or bounced. Businesses couldn't verify receipt of critical payment documents.
Billmator integrated Sendmator's multi-channel API to automate invoice delivery, payment reminders, and receipts across email, SMS, and WhatsApp with full delivery tracking and retry logic.
When a business creates an invoice in Billmator, Sendmator automatically delivers it to the customer via email with the PDF attachment within 30 seconds.
Scheduled job runs daily to find overdue invoices. Sends multi-channel reminders based on how many days overdue (email → SMS → WhatsApp escalation).
When payment status changes to "paid", Sendmator instantly sends a payment receipt email with transaction details and updated invoice PDF.
Billmator created a centralized EmailService that handles all Sendmator API calls:
// src/services/email.service.ts
import { Injectable } from '@nestjs/common';
@Injectable()
export class EmailService {
private readonly SENDMATOR_API = 'https://api.sendmator.com/v1';
private readonly API_KEY = process.env.SENDMATOR_API_KEY;
async sendInvoice(invoice: Invoice, customer: Customer) {
const response = await fetch(`${this.SENDMATOR_API}/email/send`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${this.API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: customer.email,
from: invoice.business.email,
template_id: 'invoice_delivery',
variables: {
customer_name: customer.name,
invoice_number: invoice.invoice_number,
amount_due: invoice.grand_total,
due_date: invoice.due_date,
payment_link: `https://billmator.com/pay/${invoice.id}`
},
attachments: [{
filename: `invoice-${invoice.invoice_number}.pdf`,
content: invoice.pdfBase64,
encoding: 'base64'
}]
})
});
// Store delivery tracking ID in invoice metadata
const result = await response.json();
await this.invoiceRepo.update(invoice.id, {
metadata: {
...invoice.metadata,
sendmator_message_id: result.message_id,
sent_at: new Date()
}
});
}
}
Billmator configured webhooks to track email opens, clicks, and bounces:
// src/webhooks/sendmator.controller.ts
@Post('sendmator/webhook')
async handleSendmatorWebhook(@Body() payload: any) {
const { event_type, message_id, metadata } = payload;
switch (event_type) {
case 'email.delivered':
// Update invoice with delivery confirmation
await this.invoiceRepo.update(
{ 'metadata.sendmator_message_id': message_id },
{ 'metadata.delivered_at': new Date() }
);
break;
case 'email.opened':
// Track when customer opened invoice
await this.invoiceRepo.update(
{ 'metadata.sendmator_message_id': message_id },
{ 'metadata.opened_at': new Date() }
);
break;
case 'email.bounced':
// Alert business owner about bounced invoice
await this.alertService.notifyBounce(message_id);
break;
}
}
Scheduled job runs daily to send payment reminders for overdue invoices:
// src/jobs/payment-reminders.service.ts
@Cron('0 9 * * *') // Every day at 9 AM
async sendPaymentReminders() {
const overdueInvoices = await this.invoiceRepo.find({
where: {
payment_status: In(['unpaid', 'partially_paid']),
due_date: LessThan(new Date())
},
relations: ['customer', 'business']
});
for (const invoice of overdueInvoices) {
const daysOverdue = this.calculateDaysOverdue(invoice.due_date);
if (daysOverdue === 3) {
// Email reminder
await this.emailService.sendTemplate(
invoice.customer.email,
'payment_reminder_gentle',
{ invoice_number: invoice.invoice_number, amount_due: invoice.amount_due }
);
} else if (daysOverdue === 7) {
// SMS reminder
await this.smsService.sendTemplate(
invoice.customer.phone,
'payment_reminder_urgent',
{ amount_due: invoice.amount_due, payment_link: `billmator.com/pay/${invoice.id}` }
);
} else if (daysOverdue === 14) {
// WhatsApp reminder
await this.whatsappService.sendTemplate(
invoice.customer.phone,
'payment_reminder_final',
{ invoice_number: invoice.invoice_number, amount_due: invoice.amount_due }
);
}
}
}
All invoices delivered successfully with retry logic
Automated reminders reduced average payment time
vs. SendGrid + Twilio + separate WhatsApp provider
"Sendmator transformed how we deliver invoices. What used to take our team hours of manual work is now completely automated. The multi-channel support means our customers get invoices however they prefer, and automated payment reminders have reduced our average collection time by 35%. The integration took just 4 hours, and we're saving over $1,200 monthly compared to our previous solution."
Send invoice PDFs as email attachments with personalized templates and variables
Multi-channel payment reminders via SMS and WhatsApp for urgent notifications
Reusable templates for invoices, reminders, and receipts with dynamic variables
BullMQ-based retry logic ensures 99.9% delivery rate even with temporary failures
Real-time webhooks for delivery, open, click, and bounce events
Team-based API keys allow each business to have isolated email sending
Start with 100 free emails. Integrate in under 4 hours like Billmator.
No credit card required • 100 free emails to start