Send User Email

Description

Sends an email.

This service calls the SendEmail service to actually send the email. SendUserEmail is different from SendEmail in the following ways.

  • It does not have host, port, user or password parameters for the email. Instead, it relies on the configuration parameters or default in SendEmail.
  • It requires user authorisation. The user must be authorised to send emails.
  • It does not allow the replyTo parameter; reply to is always set to the current user.
  • It does not allow the from parameter; from is set by an account-wide or system-wide default. The account-wide default is read from the system.PROPERTIES.emailFrom property of the account properties node.
  • It has an option to allow the user to send a copy to themselves. (This is achieved simply by appending the current user to the bcc list.)
  • It validates that the caller is authorised to read attachments.

The name of the service to call is specified by the configuration parameter sendEmailService, which defaults to "SendEmail".

Input

<SendUserEmail>
  <userLogonReference/>
  <password/>
  <to/>
  <cc/>
  <bcc/>
  <subject/>
  <format>plain|html</format>
  <message/>
  <AttachmentList>
    <Attachment>
      <nodeVersionReference/>
      <name/>
    </Attachment>
  </AttachmentList>
  <copySelf>false|true</copySelf>
</SendUserEmail>

<to>, <cc> and <bcc> can contain a list of email addresses, separated by commas or newlines. Each email address can be:

  • An email address, e.g. "my.name@somewhere.com".
  • An name and an email address, e.g. "My Name <my.name@somewhere.com>"

Remember that the < and > in the email address must be ecaped, e.g.

<to>Your Name &lt;your.name@somewhere.com&gt;</to>

Format specifies the format of the message. If the format is html, then the message should contain only the body contents. The message will be run through the HTML Filter. HTML markup should be escaped, e.g

<message>&lt;p&gt;Hello World!&lt;/p&gt;</message>

<AttachmentList> is optional, and <Attachment> repeats within it. It contains the node version reference of a file to be attached. <name> is optional and provides a name for the attachment. If not given, the local reference and extension of the node will be used.

If <copySelf> is true, then the current user is appended to the cc list.

Output

<SendUserEmail>
<errorNumber>0</errorNumber>
</SendUserEmail>

Errors

101 - Not authorised

103 - parameter error

105 - user error

Class

com.metrici.xerula.SendUserEmailService