Automating Secure Invoice Delivery with AttachmentMailerTool
AndySqlman

AndySqlman @sqlman

About: DBA, Data Analyst, Java Programmer, A member of the SQLMessenger Development Group

Joined:
Jul 10, 2024

Automating Secure Invoice Delivery with AttachmentMailerTool

Publish Date: Jun 27
5 0

Automating Secure Invoice Delivery with AttachmentMailerTool

Every month, I need to send invoices (PDF format) to a large number of clients. To protect client privacy, each PDF file must be password-protected. The password format we use is the client's account number combined with the last four digits of their phone number. To automate this process, we use the AttachmentMailerTool plugin from SQLMessenger.

Why AttachmentMailerTool?

AttachmentMailerTool not only allows us to send each client's invoice individually via email, but it also supports:

  • Admin Passwords and Open Passwords for PDF files
  • Adding watermarks to PDFs if needed

It's a flexible and secure tool that helps us streamline the entire document delivery process.


Step-by-Step Instructions

1. Prepare Your Spreadsheet

First, I prepare a spreadsheet with the required columns for AttachmentMailerTool. The necessary columns are:


To_Emails, CC_Emails, Subject, Body, File_Path, Admin_Password, Open_Password, Watermark_Text

Image description
You can refer to the "AttachmentMailerTool Manual - Column Descriptions" for details about each column.

Image description

Here's how I populate each column:

Column Name Type Description
To_Emails Formula Since column G already contains the client’s email address, I use the formula =G2 to copy it into the To_Emails column.
CC_Emails Empty Since we don’t need to CC anyone, this column is left blank.
Subject Formula I use the formula ="Your "&A2&" Invoice is Attached" to include the invoice month (from column A). For example, the subject becomes: Your June 2025 Invoice is Attached
Body Formula I use a formula to generate an HTML email body for better formatting. The formula is long, so I won’t include it here, but you can contact me if you’d like a copy. You can also insert your company logo into the email body.
File_Path Formula All invoice files are stored locally in d:\invoice\, with each client having their own folder. For example, client CN001’s June invoice is saved as: d:\invoice\cn001\Invoice-June-2025.pdf I use this formula to generate the file path: ="D:\invoice\"&C2&"\Invoice-"&SUBSTITUTE(A2," ","-")&".pdf" (Column A contains the month like "June 2025", and Column C contains the client account number.)
Admin_Password Text Enter {[AUTO]} to have AttachmentMailerTool generate a random admin password for each PDF automatically.
Open_Password Formula =LOWER(C2)&RIGHT(F2, 4) This combines the client account (column C) and the last 4 digits of the phone number (column F).
Watermark_Text Empty Leaving this column blank means no watermark will be applied to the PDF.

2. Running the Task in SQLMessenger

(1). In SQLMessenger, double-click the AttachmentMailerTool icon to open the task window.

Image description

(2). Click Information Distribute, then click Import Recipient List.

Image description

(3). Click Browse to select the prepared Excel file, then click OK.

Image description

(4). Review the imported data to ensure all information is correct. Click OK to proceed.

Image description

(5). The system will now generate the emails, but will not send them immediately. This is a safety feature to prevent accidental sending of incorrect emails.

3. Approving and Sending Emails

We can review the generated emails in two ways:

  • Click View Results of the Task Instance in the task log.
  • Or go to MainMenu → Message Approval.

Image description

In the approval window, we can click the email icon to preview each email’s content.

Image description

Image description

Once we’ve confirmed the emails are correct:

  1. Click Approval & Send, then select Approve All.

Image description

  1. Check "Approved, send the messages generated by the selected task instances", and click OK.

Image description

The system will now begin sending emails. You can monitor the sending progress under: Email & Message Manager → Outbox

Image description


Summary

This case demonstrates how SQLMessenger's AttachmentMailerTool can streamline and secure the monthly invoice distribution process. By leveraging dynamic formulas in Excel and automated email generation, we can efficiently send personalized, password-protected PDF invoices to each client.

The tool's ability to add admin and open passwords, as well as optional watermarks, helps ensure document confidentiality and compliance. With built-in message approval before sending, AttachmentMailerTool also reduces the risk of human error.

Overall, this solution saves time, improves accuracy, and enhances the professionalism of client communications.


Need a More Customized Solution?

The AttachmentMailerTool plugin is designed to meet the majority of common email distribution needs, including sending personalized emails with password-protected PDF attachments.

However, if the built-in features do not fully meet your requirements—for example, if you need to customize more advanced or personalized email body templates—you are welcome to contact the SQLMessenger development team. They are happy to provide free, personalized solutions tailored to your specific needs.


For more information about AttachmentMailerTool, please visit:

🔗 https://www.sqlmessenger.com/manual/plugin-attachmentmailertool-index.htm

📧 Contact the SQLMessenger Team: support@sqlmessenger.com

Comments 0 total

    Add comment