MassMailer Template for PHPRunner and ASPRunner.NET

MassMailer adds scheduled email and SMS functionality to PHPRunner and ASPRunner.NET applications. Use it to send newsletters, billing reminders, scheduled reports, notifications and other recurring or one-time messages based on your application data.

You can get this template for $50.

Buy now

Already own MassMailer template v1, v2 or v3? Upgrade to version 4 for $25.

Note: MassMailer requires a valid license of PHPRunner or ASPRunner.NET version 11.1 or later.

Key features

  • Send newsletters and one-time email campaigns
  • Schedule recurring messages by minute, hour, day, week or month
  • Send email, SMS or both
  • Select recipients and data using SQL query files
  • Use database values in email subjects, recipients and message bodies
  • Create repeating sections using additional SQL queries
  • Send file attachments
  • Attach PHPRunner or ASPRunner.NET pages as HTML or PDF
  • Manage subscription lists with opt-in and unsubscribe support
  • Preview messages and send test emails before delivery

Screenshots

Click images for full-size screenshots.

List of tasks
Single task setup
Email body and attachments
SQL Query results view
SQL Query help
Email preview
Template syntax help

Setup instructions

1. Configure email settings in PHPRunner or ASPRunner.NET under Miscellaneous > Email settings.

2. Create the SQL query that supplies recipients and other data for the task. Save the query as a .sql file in the queries folder of the generated MassMailer application.

For example:

MassMailer reads SQL queries from files instead of allowing an administrator to enter arbitrary SQL directly in the application. Only .sql files located in the queries folder are available for selection.

3. Create a new MassMailer task and select the appropriate SQL query file. For a one-time task such as a newsletter, choose the manual interval. For recurring messages, choose the appropriate schedule.

4. Populate fields such as To, Subject and Email body. You can insert fields returned by the SQL query using placeholders such as %Email% or %FullName%.

5. Preview the message and send a test email. If everything looks correct, save the task.

6. For recurring tasks, schedule the MassMailer cron endpoint to run regularly.

PHPRunner

The MassMailer scheduling URL is:

https://yourwebsite.com/massmailer/cron.php

For example, on a Linux server you can call the URL once per hour with:

ASPRunner.NET

The MassMailer scheduling URL is:

https://yourwebsite.com/massmailer/cron

You can use your server's scheduler or any external scheduling service capable of requesting this URL at the required interval.

SQL Query Help

MassMailer uses SQL queries to determine which records should be processed and which database fields are available to the email template.

Create each query as a separate .sql file and place it in the application's queries folder. The query will then appear in MassMailer for selection.

SQL syntax depends on your database. The following examples show several common scheduling queries. Replace mytable and expiration_date with your actual table and field names.

MySQL

All records:

Records where the expiration date is 30 days away:

Records that expired 30 days ago:

SQL Server

All records:

Records where the expiration date is 30 days away:

Records that expired 30 days ago:

Microsoft Access

All records:

Records where the expiration date is 30 days away:

Records that expired 30 days ago:

You can use any valid query supported by your database. The fields returned by the query become available as placeholders in the MassMailer template.

Template Language Help

MassMailer email templates can contain plain text or HTML together with placeholders populated from your SQL query results.

Database field placeholders

If the selected SQL query returns fields such as:

ID, FullName, AccountNumber, AmountOwed, DueDate

you can use those fields directly in the message:

When MassMailer generates the message, each placeholder is replaced with the value from the current database record.

Placeholders are case-insensitive. You can also include the SQL query alias:

%main.AccountNumber%

HTML email

Templates can contain HTML. Enable the HTML email option when using HTML markup in the message body.

Repeating sections

Additional SQL queries can be used to insert multiple related records into a single message.

For example, an additional query named orders might retrieve all orders belonging to the current customer. The additional query can reference values returned by the main query:

The corresponding repeating section in the message template is:

The name after %section must match the alias of the additional SQL query.

You can use multiple repeating sections in a template. Nested repeating sections are not supported.

Unsubscribe links

When sending to a subscription list, insert:

%unsubscribe%

MassMailer replaces this placeholder with the appropriate unsubscribe link.

Changes history

Version 4.0 - December 2018

  • Compatibility with PHPRunner and ASPRunner.NET 10.x

Version 3.0 - November 2017

  • Bootstrap-based layouts
  • Send email, SMS or both
  • Schedule delivery by day of week
  • Attach a project page as HTML or PDF

Version 2.1 - January 2016

  • Simplified customization of Add and Edit task pages
  • Added Reply-To field

Version 2.0 - May 2015

  • Email attachments
  • Multiple subscription lists
  • Bulk subscriber import
  • Subscription form and unsubscribe link
  • Single and double opt-in
  • Subscription-list recipient selection

Version 1.1 - March 2015

  • Repeating sections in message templates
  • Execute SQL after each email

Version 1.0 - February 2015

  • Template-based emails
  • Email scheduling
  • Email preview
  • Built-in SQL and template syntax help

System requirements

MassMailer requires PHPRunner or ASPRunner.NET version 11.1 or later and works with databases supported by those products.

Frequently asked questions

I've created a task but don't want it to run yet. Can I make it inactive?

Yes. Set the task interval to manual. It will not be executed by the scheduler and can be started manually when needed.

My email addresses are stored in a database field. How do I use them?

If your selected SQL query returns a field named EmailAddress, enter:

%EmailAddress%

in the To field. MassMailer replaces the placeholder with the value from each record.

How do I use "Execute SQL query after email sent"?

This field is optional. Use it when you need to update a record after a message has been sent, for example to mark a notification as sent.

The %main.CustomerID% placeholder is populated from the current record returned by the main SQL query.

How do I execute multiple queries after an email is sent?

Separate the statements with semicolons:

How do I insert an unsubscribe link?

Insert %unsubscribe% anywhere in the message body. This placeholder is intended for messages sent to MassMailer subscription lists.

How do I change the From address or SMTP settings?

Configure these settings in PHPRunner or ASPRunner.NET under Miscellaneous > Email settings.

What is the subscription form?

The MassMailer subscription form is HTML that can be embedded into another page of your website so visitors can subscribe to a mailing list. It inherits the styling of the surrounding website.

Subscriptions are submitted using AJAX, so the page does not need to reload.

How do I format date values in an email?

Format the value in the SQL query and give the formatted expression an alias that can be used in the message template.

For example, in MySQL:

You can then use %DueDate% in the email template. Date-formatting syntax differs by database.

How do I insert an image into an HTML email?

Use an HTML img element with a complete HTTPS URL to the image:

Can MassMailer send SMS messages?

Yes. MassMailer can send email, SMS or both. SMS delivery uses the SMS provider configured in PHPRunner or ASPRunner.NET.

Can I attach a PHPRunner or ASPRunner.NET page to an email?

Yes. MassMailer can attach a project page as HTML or PDF. You can send the same attachment to all recipients or generate an attachment using data belonging to each individual user.

Do you have a more advanced MassMailer example?

See the MassMailer password expiration and reminder example.