Understanding automatic messages
alameen ERP 10 can send e-mail, text and WhatsApp messages to customers and users without anyone pressing a send button. You define once what is sent, when, and to whom. The system then sends it by itself. This page explains the idea. The fields and buttons are in Messages Management.
The feature appears in the program when your licence includes the messaging system. It is not the same as the notifications in the bell panel. Those alert the person working on the screen. These messages reach the phone, the mailbox or the WhatsApp of a customer or a colleague.
An automatic message: what you define
The definition of an automatic message holds four things:
- When: an event in the program, or a date on the calendar.
- A condition: whom or what the message is about, such as one account, a cost center, a customer group or some commercial paper forms.
- To whom: the customer concerned by the operation, and the users you choose.
- What: the message text. It holds fields that are replaced by the data of the operation, such as the customer name, the value of a paper and its maturity date. An e-mail also has a subject.
You define messages in Messages Management. Each message has a name. In most types it must not repeat among the messages of the same type; in Account Movement this is checked only when you modify a saved message.
Event messages and scheduled messages
Event messages
A message is tied to an event that happens when a user does something in the program: saves an invoice or an entry, or runs an operation on a commercial paper. After the operation succeeds, the program tells the database about the event. The database checks every message defined for that event. When the condition is met, it puts the message in the sending queue.
| Type | The event happens when | Where the definition is explained |
|---|---|---|
| Account movement | An entry that has an item on the account you chose is posted, as debit or as credit according to your choice. The database detects the posting by itself, not the entry window. | Account Movement Messages |
| Commercial papers | A user runs an operation on the paper in the commercial paper window: issue, modify, receive, pay, send for collection or for discounting, endorse and the other events of the list. It happens only after the operation succeeds. | Messages of Commercial Papers |
| Invoices, orders, entries and materials control | A user saves, posts or modifies the invoice, the order or the entry, or the quantity of a material changes. | Invoices Messages, Orders Messages, Entry voucher messages, Messages of Materials Control |
The program does not wait for the result of sending. The user goes on working, and the database server carries out the remaining steps.
Scheduled messages
These messages leave at their time. No user has to do anything, and nobody has to be working in the program. A scheduled job in SQL Server Agent starts them, so that tool must be running on the server. The Messages Settings window reminds you of this. There are two kinds:
- The daily job that the Create button makes in Messages Settings. It runs once a day at the time you set. It checks invoice maturity dates, commercial paper maturity dates, the due payment date in orders, material expiry, customer birthdays and congratulation dates. The reminder message "Reminder before Maturity Date" is sent that many days before the date, as you set.
- One job for each scheduled message. Every message of the type Accounts Balances has its own schedule type, day and time, and its own job. The special occasion of the type "Scheduled Info" also has its own job. It runs at the time set in Messages Settings, with the schedule type and day that you choose. Every one of these jobs sends all the Scheduled Info messages of the file, so with more than one such message each is sent at the times of all of them.
Every scheduled job runs between the first date and the last date of the file's period. After you restore a backup on another server, rebuild the jobs with Messages Maintenance.
Channels
Each message has one channel: e-mail, text message or WhatsApp. For some types you define the same text for several channels at once.
| Channel | What it needs | Who receives | Notes |
|---|---|---|---|
| An e-mail account set up and tested in the share settings, with the e-mail service enabled there. | The e-mail of the user from the user card. The e-mail of the customer (first and second) when Send E-mail is on in the customer card. | The subject is required. The text arrives as a web page, so line breaks and text direction are kept. Invoice messages can attach the archived copy of the invoice. | |
| Text message | An SMS provider set up and tested in the share settings, with the SMS service enabled. | The phone number of the user from the user card. The mobile of the customer (first and second) when Send SMS is on in the customer card. | Plain text, no subject. |
| A WhatsApp provider set up in the share settings. | The number of the user. The mobile of the customer (first and second) when Send WhatsApp Message is on in the customer card. | The settings page has no switch for this service. Invoice and order messages have an option to attach the archived invoice. |
The steps to set up the accounts are in Set up e-mail, WhatsApp and SMS sharing, and their fields in Sharing and connection. This page does not repeat them. Three rules concern automatic messages:
- The program lets you add an e-mail or text message to a definition only when the service is set up and has been tested successfully. Otherwise a message asks you to check the messages settings. A WhatsApp message is added without a check.
- A Microsoft account sends what starts with an operation of a user. It does not send scheduled messages. See the page above.
- The messages are sent from the database server itself, not from the user's computer. The server must reach the internet, and the SQL Server account must allow the database to be prepared for messages when you save the share settings.
The customer card holds the sending data and its check boxes: Data of Sending E-mails and Messages.
When and how messages leave
- An event or a date. The program tells the database about an event, or the time of a scheduled job arrives.
- The check. The database finds the messages defined for this event and checks the condition of each. If the event has no defined message, or the condition is not met, nothing happens.
- The recipients. The users selected in the message, and the customer concerned when Customer is selected. A customer whose card does not allow this channel gets nothing.
- The text. The fields of the message are replaced by the values of the operation, and the ready message goes into the queue of its channel.
- Sending. The database server sends the message through the e-mail account, the SMS provider or WhatsApp. Text messages have their own queue. E-mail and WhatsApp messages share another one.
The program need not be open when scheduled messages are sent. The program starts event messages when the user does the operation, and the database does the rest.
When sending fails
- The user who did the operation sees nothing. The operation succeeds, and no sending error appears.
- Errors are recorded in the error list of the channel. The database keeps the message that did not leave, with the error text and the time of the attempt. A counter for each list is shown by the messaging error tiles on the home page.
- There is no automatic retry. A message is sent again only when a user resends it from the error list. A resent message gets the state "being resent", then the sending updates it with the result. In the WhatsApp list, the message is removed from the list when resent, whatever the result of the new attempt.
- A switched-off channel. If you clear Enable Service for e-mail or for text messages in the share settings, the messages of that channel are dropped when their time comes, with no record.
- Errors in the queue and the conditions, such as a condition function that cannot run, are written to technical logs in the database. No window shows them.
- What is not recorded as an error. A text message is recorded as failed only when the sending itself cannot run. When the SMS provider answers with a refusal, no message is saved in the list. An e-mail from a Microsoft account with no sign-in token is treated the same way.
Example
You want the customer to get a text message when you receive a paper from them, and a reminder three days before the maturity date of a paper.
- Set up the SMS account in the share settings and test it. Then create the daily job in Messages Settings.
- In Messages Management > Commercial Papers, add a message named "Paper received". Choose the paper form and the customer group. Add the event Receive, and a text message to Customer.
- In the same message add Reminder before Maturity Date, type
3days, and a text message to Customer. - When the accountant receives the paper in the commercial paper window, the customer gets the receipt message. Every morning (at the time of the daily job) the reminder goes out for the papers that mature exactly three days later.
Related
This page applies to alameen ERP 10, version 10.1.79.764.