Handling Email and SMS Messages
On this page:
Messaging Procedure
To send message the application must save the message information into the database with all of the prerequisites fulfilled.
After the message is sent the
notification_time
field is additionally set with
CALL_REMOTE_viewed
method when the user opens the
Messaggi ricevuti
menu.
Message Forwarding
The
/opt/masonsql/bin/cronjobs
file is forwarding authority for email messages and text messages in the queue.
It reads the
PerlSetVar
variables from Apache config file. The queue is queried from the
public.messages
table.
The
cronjobs
file is scheduled in
/etc/crontab
file to run every minute.
Email Forwarding
The message is sent when all these prerequisites are fulfilled:
- the
messages_users.email_result
field is NULL or contains an error,
- when the
messages_users.notification_time
is NULL,
- when the
messages.transmission_time
is not NULL,
- when the
messages.email
field is TRUE.
After the message is sent the
cronjobs
file writes a note in the
messages_users.email_result
which at the same time also disables the resending of the message.
General Email Settings
Variable Name |
Description |
Sample Values |
MailXMailer |
X-Mailer address in email header. |
"MyAppXMailAddress" |
MailMax4Connection |
Maximum number connection retries to the SMTP server. |
"3" |
MailForceTo |
Force all mails to this address with the messages_users.id value prepended to a mail header. The variable is used for development purposes. Otherwise, when the variable is not set, emails are sent to the an user's email address from the anagrafiche.email field. |
"name.surname@provider.com" |
MailSMSOrdininiInConsegna |
|
|
Sender Email Settings
Setting Name |
Variable Name |
Description |
Sample Values |
smtp |
MailSmtpServer |
SMTP server address. |
"smtp.emaildomain.com" |
auth |
AuthType |
Authentication type. |
"PLAIN" |
client |
Auth_AC_Domain |
|
"my-development-domain.com" |
from |
MailFrom |
From address in email header. |
"my_user_auth@mydomain.com" |
authid |
MailAuthid |
Authentication ID. |
"my_user_auth@mydomain.com" |
authpwd |
MailAuthpwd |
Authentication password. |
"MailAuthPassword" |
port |
MailPortServer |
SMTP port number. |
"36" |
charset |
Charset. |
Set to: 'utf8' |
|
keepconnection |
|
Set to: 1 |
|
on_errors |
|
Set to: 'code' |
|
SMS Settings