Skip to main content
< All Topics
Print

Sending emails (forum)

The forum emails are sent by the program send_emails.unified.php. It requires wp-load.php to be able to use the WordPress function to access the database, even if it is a program stand alone.

It sends three types of message stored in three elements in the table topics with a differen type:

1: expiration message one day before the expiration day
2: expiration message seven day after the expiration day
0: message written by a associate or by the administrator.

Expiration emails are send on the basis of a test of the day, not regarding the hours. So the test is made just once a day. The type of run is determined on the basis of the run time a quarter of an hour less or more: 03:00 type = 1, 04:00 type = 2.table topics_parameters, ex

After submitting an announcement to the forum, the user can  change the message for a certain time after the insertion time. The time (in hours) is stored in the table topic_parameters and in the  fields revision_time for a user and revision_time_admin for the administrator.

When the revision time is finished, the message becomes visible to the other members as well.

The message of type = 0 can follow the sending of messages of type 1 or 2.

Both for the expiration message and the associate/administrator message there are two steps:

– first check if a message is present
– if any checks for the recipients.

At the end of the sending of a topic, it is set to the state of sent.

When an email is sent, a record is inserted into the table topics_email. So when the program search for the recipients of a topic not in the state of sent, it can check if an associate has not received that topic (this can be due to a preceding run not terminated correctly).

The smtp.hostinger.com is used to send the emails. It doesn’t allow to send more than 60 emails in the same run. So the check on the status of sent is useful to overcome the problem.  A test will be performed using smtp.gmail.com.

Il the table topic_parameters there are two parameters to facilitate the debugging:

  • test_mode: if set to 1, all the emails are sent to the address stored in the following field
  • test_mail.

Besides field system_status enables (set to 1) or disables (set to 0) the sending system.

Table of Contents
Moisa Society
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.