With the E-Mail Service it is possible to send E-Mails for notifications of updates.
More...
With the E-Mail Service it is possible to send E-Mails for notifications of updates.
- Author
- Philip Wendland
unicopa.copa.server.email.EmailService.EmailService |
( |
Properties |
smtpProps, |
|
|
Map< String, InputStream > |
texts, |
|
|
FileHandler |
logFH |
|
) |
| |
Create a new EmailService.
- Parameters
-
smtpProps | the environment properties used by the JavaMail API. The path to the file is "/email/smtp.properties". You should provide mail.smtp.host - specifies the host address of the SMTP-Server you wish to use, e.g. smtp.example.com mail.smtp.auth - specifies, whether authentication is necessary in order to be able to connect to the SMTP-Server (true/false - true in most cases) mail.smtp.port - specifies the port of the SMTP-Server to connect to, e.g. 587 mail.from - specifies the return E-Mail address of the sent E-Mail, i.e. info@.nosp@m.exam.nosp@m.ple.c.nosp@m.om username - the username of the user (if mail.smtp.auth=true) password - the password of the user (if mail.smtp.auth=true) for the EmailService to work properly. |
texts | a Map of <String, InputStream> where the key is a (String-)identifier for the specific template which is read from the InputStream. The path to the files is "/email/templates/". The name of the file is for example "default_newAppointment_english.txt" (see the email configuration folder for more information) The following example shows the format of the text template: The first line is the E-Mail subject line The message body begins with the second line. You can add expressions from unicopa.copa.server.email.TextPatterns (i.e. _UPDATE_DATE, _CREATOR_NAME, _COMMENT, _LOCATION, _DATE, _SUPERVISOR, _EVENTGROUP_NAME, _EVENT_NAME). These expressions will be replaced by the data from the SingleEventUpdate before sending E-Mails with the method notifySingleEventUpdate. This will also work in the subject line! |
- See Also
- unicopa.copa.server.email.TextPattern
Sends E-Mails to notify the given recipients of the SingelEventUpdate.
Note: The format of the E-Mail depends on the data obtained from the parameter "update" and the "TextID" obtained from the parameter contexts. For each TextID there should be one entry in the "texts" parameter which was passed to the constructor when you created your EmailContext object.
- Parameters
-
contexts | a list of EmailContexts (Containing E-Mail-Addresses and TextID's) |
info | the information that should be passed to the recipients |
- Exceptions
-
- See Also
- unicopa.copa.server.email.UpdateInformation
-
unicopa.copa.server.email.EmailContext
void unicopa.copa.server.email.EmailService.postMail |
( |
String |
recipient, |
|
|
String |
subject, |
|
|
String |
message |
|
) |
| |
Sends a simple plain-text E-Mail.
- Parameters
-
recipient | the recipient the E-Mail should be sent to, i.e. x@y.c.nosp@m.om |
subject | the subject of the E-Mail |
message | the plain-text body of the E-Mail |
- Exceptions
-
final Logger unicopa.copa.server.email.EmailService.LOG |
|
static |
The documentation for this class was generated from the following file:
- CopaServer/src/main/java/unicopa/copa/server/email/EmailService.java