Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Jul 13, 2018
1 parent 8027b1a commit bda4c4b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,23 @@ public void close(boolean rollbackTransaction) throws PluginException {
}

/**
* Computes the sender name. This method can be overwritten by subclasses.
* Computes the sender name. A sender can be defined by the event property
* 'namMailFrom' or by the system property 'mail.defaultSender'. If no sender is
* defined, the method takes the current username.
*
* This method can be overwritten by subclasses.
*
* @param documentContext
* @param documentActivity
* @return String - mail subject
* @return String - mail seder
*/
public String getFrom(ItemCollection documentContext, ItemCollection documentActivity) {

String sFrom = null;
// test if default sender is defined
if (getWorkflowService().getPropertyService() != null) {
// test if namMailReplyToUser is defined by event
String sFrom = documentActivity.getItemValueString("namMailFrom");

// if no from was defined by teh event, we test if a default sender is defined
if (sFrom.isEmpty() && getWorkflowService().getPropertyService() != null) {
sFrom = (String) getWorkflowService().getPropertyService().getProperties().get("mail.defaultSender");
}
// if no default sender take the current username
Expand Down Expand Up @@ -518,8 +524,7 @@ public void initMailMessage() throws AddressException, MessagingException {
* The method can be overwritten by subclasses to return a different
* mail-address name or lookup a mail attribute in a directory.
*
* @param aAddr
* string
* @param aAddr string
* @return InternetAddress
* @throws AddressException
*/
Expand Down Expand Up @@ -548,8 +553,7 @@ public InternetAddress getInternetAddress(String aAddr) throws AddressException
* This method transforms a vector of E-Mail addresses into an InternetAddress
* Array. Null values will be removed from list
*
* @param String
* List of adresses
* @param String List of adresses
* @return array of InternetAddresses
*/
@SuppressWarnings("rawtypes")
Expand Down
4 changes: 2 additions & 2 deletions src/site/markdown/engine/plugins/mailplugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ The following event properties are supported:
|Name |Type | Description |
|----------------------|-----------|-----------------------------------------------|
| txtMailSubject | String | Mail Subject |
| rtfMailBody | String | Mail Body (can be plain text or HTML |
| rtfMailBody | String | Mail Body (can be plain text or HTML) |
| namMailReplyToUser | String | Reply To address. If not set the reply address is the sender address |
| namMailReceiver | String (list) | Receiver list (TO) |
| namMailFrom | String | Sender (default is the current user) |
| namMailReceiver | String (list) | Receiver list (TO) |
| namMailReceiverCC | String (list) | Receiver list (CC) |
| namMailReceiverBCC | String (list) | Receiver list (BCC) |
Expand Down

0 comments on commit bda4c4b

Please sign in to comment.