Elephant uses a mail queue system to allow modules to send notifications, status information and publications. Each user can configure whether to receive messages from specific categories and, when available, in which period.
Elephant mail API
The API treats the don't want to receive these emails as a especial period, in order to remind when a user explicitly set this option. Also, categories define which periods are allowed and the default period to use when not specified. The periods are:
DONT_SEND |
Do not send mails from this category. |
AS_GENERATED |
Send mails as they are generated by modules. |
DAILY, |
Send a resume for this category in the specified period, in a single email. |
The notifiers behavior may vary when the user hasn't specifically set a period option. User will be treated as a Participant (may want) or as an Observer (wants), depending on how module qualifies it. The following table shows how operates:
Subscription |
Not set |
Period set |
Don't send |
Wants |
Don't send |
Send |
Don't send |
May want |
Send |
Send |
Don't send |
Similar behavior applies to user's agreements. See Agreements .
To better understand the differences, lets take two examples: issue tracking and publications.
Issues depend on users participation, a role sharing type of share. We know a user may want to know when an issue changes state, if he participates in this issue. The default notifier action will be try to send the notification. If the user hasn't specifically set a period option, the default category option will be used.
Publications are sent to subscribers. The notifier will send the publication to those users whom specifically have set a period option.
The Elephant Mail Queue API requires a task to be created for each existent period. These tasks are configured by default. The idea behind is to permit platform administrators to change things like the hour in which daily summaries are sent, the day for monthly summaries, and so forth.
|
Expands to text-to-show linked to live-link with the user auto-authenticated. Valid for a period of seven days. |
|
Expands to live-link with the user auto-authenticated. Valid for a period of seven days. |
|
Expands to the user name. |
|
Expends to the user email. The one set as Email in contact connectors. |
|
Expands to the friendly user name (using complex name). |
|
Expands to the formal user name (using complex name). |
Images aren't included in emails. Instead, images are links to the site. This means that the email client is responsible of reading them in order to be shown. Some god practices when uploading images are:
a
to z
, A
to Z
, .
(point), -
(hyphen), _
(underline) and 0
to 9
. (Notice that ç
, Ç
, ñ
and Ñ
are not in these ranges)The recommendation for images with live links (auto-authenticated links) is:
System queue is used to send admin notifications to site administradors, password reminders to users and more of the kind. The system queue is private, users can't change sending period. The logic used when sending is the User may want approach, which means that users will receive notifications except when explicitly set to DONT_SEND
. Although administradors can set periods for this queue, it's not recommended. System notifications are better sent AS_GENERATED
.
Elephant allows sending direct emails through the Mail API. This method is used, for instance, when sending activity emails from BrightSide Dossiers module.
The Elephant Mail API defines a way for intercepting responses to direct emails. The method requires to declare a MailReader
. The usual form to declare a MailReader
is in the elephant_[module].xml
file.
Processed messages will be flagged as configured in MailReader
. The rest will be left as they were.
The xml element for MailReader
s is a
Attribute |
Description |
mailhost |
The mail server domain. |
type |
The server type. Usually imap, imaps, pop3 or pop3s. |
count |
Number of messages to retrieve. Defaults to 50. |
folder |
Folder to read from. Defaults to INBOX. |
user |
User account. |
password |
User password, as is. See cryptpass for a more secured method to store passwords. |
cryptpass |
Password encrypted. Use Tools -> Password generator to generate the encrypted string. |
port |
Port to connect to. |
ssl |
Whether use SSL protocol on connect. Server defined. |
tls |
Whether to encrypt content on connect. Server defined. |
flag |
Flag to set if the message is processed. Defaults to SEEN. |
<impl interface="IMailReader_Dossier" java-class="org.turro.mail.reader.MailReader"> <attrib name="mailhost" value="imap.gmail.com"/> <attrib name="type" value="imaps"/> <attrib name="count" value="10"/> <attrib name="user" value="user@gmail.com"/> <attrib name="cryptpass" value="xxxxxxx"/> <attrib name="port" value="993"/> <attrib name="ssl" value="true"/> <attrib name="tls" value="false"/> </impl>
<impl interface="IMailReader_Dossier" java-class="org.turro.mail.reader.MailReader"> <attrib name="mailhost" value="pop.gmail.com"/> <attrib name="type" value="pop3s"/> <attrib name="count" value="10"/> <attrib name="user" value="user@gmail.com"/> <attrib name="cryptpass" value="xxxxxxx"/> <attrib name="port" value="995"/> <attrib name="ssl" value="true"/> <attrib name="tls" value="false"/> </impl>