Customer Story: Billmator

How Billmator Automates Invoice Delivery

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.

60K+
Invoices/Month
99.9%
Delivery Rate
$1,200
Saved Monthly

About Billmator

Enterprise Invoicing Made Simple

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.

Multi-tenant Architecture
Isolated data for each business
Comprehensive Invoice Management
Create, track, and manage invoices
Payment Status Tracking
Unpaid, paid, overdue, partial payments
Scalable Infrastructure
Built for 1,000+ businesses

The Challenges Before Sendmator

Manual Invoice Delivery

Each invoice had to be manually emailed to customers. With 60,000+ invoices monthly across 1,000+ businesses, this was completely unscalable.

Missing Payment Reminders

No automated system to remind customers about overdue invoices. Businesses had to manually chase payments, leading to cash flow issues.

Limited Communication Channels

Only email delivery. No SMS or WhatsApp support for urgent payment notifications or customers who prefer messaging apps.

No Delivery Tracking

Impossible to know if invoices were delivered, opened, or bounced. Businesses couldn't verify receipt of critical payment documents.

The Sendmator Solution

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.

4-hour integration • Multi-channel delivery • 99.9% delivery rate • Real-time tracking

How Billmator Uses Sendmator

1

Invoice Created → Instant Delivery

When a business creates an invoice in Billmator, Sendmator automatically delivers it to the customer via email with the PDF attachment within 30 seconds.

Template: invoice_delivery
Channel: Email with PDF attachment
Variables: customer_name, invoice_number, amount_due, due_date, payment_link
Cost: $0.0025
2

Automated Payment Reminders

Scheduled job runs daily to find overdue invoices. Sends multi-channel reminders based on how many days overdue (email → SMS → WhatsApp escalation).

3 Days Overdue: Email reminder
Template: payment_reminder_gentle
Cost: $0.0025
7 Days Overdue: SMS reminder
Template: payment_reminder_urgent
Cost: $0.015
14 Days Overdue: WhatsApp message
Template: payment_reminder_final
Cost: $0.005
3

Payment Confirmation

When payment status changes to "paid", Sendmator instantly sends a payment receipt email with transaction details and updated invoice PDF.

Template: payment_receipt
Channel: Email with updated PDF
Variables: payment_date, amount_paid, transaction_id, receipt_pdf
Cost: $0.0025

Technical Implementation

Step 1: Add EmailService to InvoicesService

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()
      }
    });
  }
}

Step 2: Handle Sendmator Webhooks (Optional)

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;
  }
}

Step 3: Automated Payment Reminders (Cron Job)

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 }
      );
    }
  }
}

Results & Impact

99.9%
Delivery Rate

All invoices delivered successfully with retry logic

35%
Faster Payments

Automated reminders reduced average payment time

$1,200
Saved Monthly

vs. SendGrid + Twilio + separate WhatsApp provider

Monthly Volume & Cost Breakdown

45,000
Invoice Emails/Month
Cost: $112.50 (45K × $0.0025)
8,000
Payment Reminder SMS/Month
Cost: $120 (8K × $0.015)
3,500
WhatsApp Reminders/Month
Cost: $17.50 (3.5K × $0.005)
$250/mo
Total Sendmator Cost
83% cheaper than previous solution

"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."

AS
Ashok Sekar
Founder, Billmator

Sendmator Features Billmator Uses

Email API with Attachments

Send invoice PDFs as email attachments with personalized templates and variables

SMS & WhatsApp API

Multi-channel payment reminders via SMS and WhatsApp for urgent notifications

Template Management

Reusable templates for invoices, reminders, and receipts with dynamic variables

Automatic Retries

BullMQ-based retry logic ensures 99.9% delivery rate even with temporary failures

Delivery Tracking

Real-time webhooks for delivery, open, click, and bounce events

Multi-Tenant Support

Team-based API keys allow each business to have isolated email sending

Ready to Automate Your Invoice Delivery?

Start with 100 free emails. Integrate in under 4 hours like Billmator.

No credit card required • 100 free emails to start