If want nBill to send reminder e-mails to yourself or to your clients, you can set up reminder records for that purpose. Reminder records are made up of a set of rules to determine who should receive an e-mail and when, and also the actual message to be sent. There are several different types of reminder for different purposes (see below).

Simply creating a reminder record and marking it as 'active' (published) does not in itself cause the e-mails to be sent at the appropriate time. To actually send the e-mails, you also need to set up a CRON job to run once every 24 hours which calls the reminder sender script (note: it is important to use 24 hourly intervals - smaller intervals will result in reminders being sent out twice, longer intervals could result in some reminders not being sent at all). This script checks through your reminder records, determines what e-mails are due to be sent out, and sends them. The reminder sender script is available for download from the nBill website.

To define your reminder records, select Configuration->Reminders from the main menu, as shown in figure 3.10.

Figure 3.10 - Accessing the Reminder List

This takes you to the list of reminders.

Tip: There is a filter available at the top of the page for you to type in the name, or part of the name of a reminder to narrow down the records that are displayed. If the text you type in appears in more than one reminder name, all of the matching records will be displayed.

Click on a reminder to edit it, or on the 'New' toolbar button to create a new reminder record. This will take you to the reminder editor, which provides the following options.

Basic Tab

Reminder Type

Sending a reminder usually requires that certain records in the database be interrogated to determine whether an order or invoice meets the criteria required for an e-mail to be sent. The actual records that are checked depend on the type of reminder you want to send. For example, to remind someone about an overdue invoice requires that nBill check the invoice records, whereas to remind someone that their order is about to expire requires checking the order records.

To enable nBill to know which records to check and what data within those records to check, you need to specify the type of reminder. There are five different types, and it is important that you select the correct type for what you want to achieve, as the difference between them is not always immediately obvious:

Payment Due - This is for courtesy e-mails to inform a client when a payment is going to be taken. It is only sent to clients whose orders are set to auto-renew. Typically, you would use this if you take a fairly large payment at infrequent intervals. If auto-renew is set to 'yes' on the order record, and the expiry date has not passed (or there is no expiry date), nBill will assume that a payment will be made (or taken by the payment service provider) on the due date - so if the recurring payment schedule has been cancelled at the payment service provider's end, nBill will not know about it, and will still send this reminder, if applicable. The wording of the default message for this reminder type reflects this (ie. it says that a payment will be taken only if a recurring payment schedule is in force). The criteria for this reminder are checked against the order records.

Order Expiry - This is a reminder that the expiry date of the order is approaching. Expiry dates on order records are only really meant for use where the order is set to auto-renew (because if it does not renew automatically, no further invoices will be generated anyway, so there is no need for it to expire). Typically, you would set the expiry date of the order to the expiry date of the card that was used to pay for the order (or rather, the payment gateway would do this for you, if supported) - that way, when the customer's card is about to expire, they are prompted (by an order expiry reminder) to set up their payments again with their new card. The criteria for this reminder are checked against the order records.

Renewal Due - When an order is set not to auto-renew, the user must renew manually (by making another one-off payment). This type of reminder will tell them when they need to do that, and provide a payment link to enable them to do so. Use this where you want to leave it up to the user whether or not to renew their subscription each year (or whatever), rather than setting up a recurring payment schedule (also useful if your payment service provider does not support recurring payments, or wants you to pay extra for the privilege). The criteria for this reminder are checked against the order records.

Invoice Overdue - When an invoice is still not marked as paid after the defined interval, use this to issue a reminder to pay the outstanding amount. The criteria for this reminder are checked against the invoice records.

User-Defined - You can use this to send a message to any particular client, or to yourself (eg. to remind you to buy a birthday present for your spouse!). The criteria for this reminder are not checked against any nBill records.

When you select a reminder type, the reminder name defaults to the reminder type value, the e-mail text is automatically populated with a default value which describes what the reminder is for, and if you select 'Invoice Overdue', the 'Send After' option will also be automatically set to 'yes' (for all others, it is set to 'no'). You can override these automatic settings though if you want.

Reminder Name

By default, this will be the name of the reminder type, but you might want to change it to something that will help you differentiate it from other reminders, especially where you have more than one of the same type.

For Example: You could have 2 reminders that are identical except that one is sent only to the Administrator, and the other is sent to the client (see 'Administrator?', below). In that case, you might want to add a suffix to the reminder name, such as ' (Admin)' or ' (Client)'.

Active?

Whether or not the reminder sender script should send an e-mail for this reminder. This is to allow you to easily publish or unpublish a reminder without having to physically delete it or re-create it.

Administrator?

Whether or not the reminder sender script should send an e-mail to the administrator only. If this is set to 'yes', you as an administrator will receive the reminder e-mail, but the client(s) will not. This is very handy for testing purposes, so you can make sure you have set up your reminder correctly before allowing it to go live with your customers. If you want to send a reminder both to yourself and to the client, you will need 2 separate reminder records (however, the reminder sender script does allow you to see the text of any messages that are sent to clients anyway).

Starting From

If you want to postpone sending reminders for this record until a certain date, you can specify a start date here. For user-defined reminders, this is the reference date from which the date the reminder e-mail becomes due will be calculated.

Number of Units

Units

The 'Number of Units' and 'Units' settings allow you to specify the interval between the event and the reminder. Whether the reminder comes before or after the event doesn't matter.

For Example: If you want to send an 'invoice overdue' reminder 30 days after the invoice is generated, you would enter '30' as the 'Number of Units', and 'Days' as the 'Units'. To send an 'payment due' reminder 1 month before the next payment date, enter '1' as the 'Number of Units', and 'Months' as the 'Units'.

Send After?

Whether the reminder should be sent after the event or not. Typically you would set this to 'yes' for 'invoice overdue' reminders, and 'no' for the other types.

E-Mail Text

This is the actual message that will appear in the reminder e-mail. Placeholders are available that will allow relevant data to be inserted at runtime. The following placeholders can be used:

Placeholder Value Inserted at Runtime
{NAME} Client Name
{VENDOR} Vendor Name
{DATE} Event Date
{INTERVAL} Number of Units
{UNITS} Type of Unit
{ORDER} Order Details
{AMOUNT} Amount Owing (nb. discounts will NOT be taken into account)
{WEBSITE} Your Website Address
{PAYLINK} Payment Link, if applicable (renewals and overdue invoices only)
{INVOICE} Invoice Number (overdue invoices only)

 

For Example: If the E-Mail Text is set to the default for overdue invoices:

Dear {NAME},

This is a reminder that invoice number {INVOICE} for {AMOUNT} has been outstanding for {INTERVAL} {UNITS}, and is therefore now overdue. Please arrange to pay this invoice as soon as possible. If you would like to pay online, you can use the following link: {PAYLINK}.

Regards,
{VENDOR}.

This might be displayed to the user as:

Dear Mr Smith,

This is a reminder that invoice number 1111 for USD 125.30 has been outstanding for 35 days, and is therefore now overdue. Please arrange to pay this invoice as soon as possible. If you would like to pay online, you can use the following link: http://www.mydomain.com/index.php?option=com_nbill&action=invoices&task=pay&document_id=17234.

Regards,
Widgets Unlimited Limited.

Client

You can restrict a reminder to one particular client by selecting a client here. If you leave this at the default value of 'Not Applicable', the reminder will be sent to every client that meets the criteria. This setting will only take effect if 'Administrator?' is set to 'no'.

Advanced Tab

Filter

This is an advanced option for those who are familiar with SQL, and who can work out the basic database structure. Whatever is inserted here will be used as part of the 'WHERE' clause in the database query that checks the records to work out which clients need to be sent what reminders. If you do not enter a valid value for an SQL WHERE clause, or try to filter on a table that is not included in the query, an error will occur, and the reminder will not be able to be sent.

For Example: Typically, you might use this to restrict 'payment due' reminders to those clients with orders that have an annual payment frequency. To do this, you would add the following text as the filter:

#__nbill_orders.payment_frequency = 'EE'