Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagehtml/xml
linenumberstrue
<mail>
	<server>
		<host>smtp.gmail.com</host>
		<port>587</port>								<!-- specify port: 25, 587 (e.g. MS Exchange and TLS) or other based on your mail server -->
														<!-- you can skip the port definition altogether to use default -->
		<username>abc@gmail.com</username>
        <password>
			<clearValue>abcdef</clearValue>
		</password>
        <transportSecurity>starttlsRequired</transportSecurity>		<!-- other possibilities: none, starttlsEnabled, starttlsRequired -->
	</server>                                           <!-- there can be more servers if necessary; they are tried in the order specified -->
    <!--
    <server>                                            <!-- Second server -->
       . . .
    </server>
    <server>                                            <!-- Third server -->
       . . .
    </server>
    -->
    <defaultFrom>abc@gmail.com</defaultFrom>
	<debug>true</debug>									<!-- standard javax.mail debugging; it is going to stdout (catalina.out)! -->
    <logToFile>mail-notifications.log</logToFile>		<!-- All notifications are logged to this file IN ADDITION TO sending them via mail. They are
                                                             logged in all cases: even if they eventually cannot be send. Implemented since 3.6.1. -->
</mail>

...

  1. can be used when you want to send messages both via mail/sms and log them into a file,
  2. can be used selectively for some classes of notifications, and not for others.

An example:

Code Block
languagexml
   <notificationConfiguration>
      <handler>
         <simpleUserNotifier>
            ...
            <transport>mail</transport>
            <transport>file:users</transport>
         </simpleUserNotifier>
         <simpleWorkflowNotifier>
            ...
            <transport>mail</transport>
            <transport>file</transport>
         </simpleWorkflowNotifier>
         <simpleCampaignNotifier>
            ...
            <transport>mail</transport>
            <transport>file</transport>
         </simpleCampaignNotifier>
         ...
      </handler>
      ...
      <file name="users">
         <file>notifications-users.txt</file>
      </file>
      <file>
         <file>notifications-other.txt</file>
      </file>
   </notificationConfiguration>

...

ItemDescriptionNote
method

Which HTTP method is used to send SMS. Currently, "get" and "post" are supported. If not specified, "get" is assumed.

since 3.7.1
urlExpressionExpression that returns constructs URL used to send SMS.since 3.7.1 (up to 3.7, this item was called url)
headersExpression

Expression that returns HTTP request headers. The expression should return 0, 1 or more string values that will be used as request HTTP headers. Each value is in the form of "name: value", i.e. a header name followed by comma, space and a header value. If one header has to have more values, such name-value pair should be present more times for the given header name.

since 3.7.1
bodyExpressionExpression that returns request body used to send SMS (as a string).since 3.7.1
bodyEncoding

Encoding to be used for the message body. ISO 8859-1 is the default. Note that if you use any other encoding, your responsibility is to provide appropriate Content-Type header (see headersExpression item). This requirement might change in the future.

since 3.7.1
username, passwordHow to authenticate to the SMS gateway.since 3.7.1
redirectToFileInstead of opening HTTP connection, writes the URL and other parameters to this file. Useful for debugging. 
logToFileIn addition to executing the expression, writes all messages to a file. Useful for debugging.since 3.7.1

...