com.ebasetech.xi.api
Interface EmailResource


public interface EmailResource

The EmailResource interface represents a single email message to be sent using one of the sendmail() methods.

Further documentation.

Since:
V4.4

Method Summary
 boolean sendmail()
          Sends the email message as specified in the email resource.
 boolean sendmail(java.lang.String[] attachmentFilePaths)
          Sends the email message as specified in the email resource together with any attachments.
 boolean sendmail(java.lang.String[] attachmentFilePaths, java.util.Map<java.lang.String,java.lang.String> attachmentTexts)
          Sends the email message as specified in the email resource together with any attachments.
 

Method Detail

sendmail

boolean sendmail()
                 throws com.ebasetech.xi.exceptions.FormRuntimeException
Sends the email message as specified in the email resource. Any substitutable fields in the email resource are replaced with values from mapped form fields.

If a failure occurs, behaviour depends on the setting of the Success of this Email is critical checkbox in the email resource:

Further documentation.

Returns:
false if there is a failure and the email resource is not marked as critical (see above), otherwise returns true.
Throws:
com.ebasetech.xi.exceptions.FormRuntimeException - if any error occurs during execution and the email resource is marked as critical (see above)
Since:
V4.4
See Also:
sendmail(String[]), sendmail(String[], Map)

sendmail

boolean sendmail(java.lang.String[] attachmentFilePaths)
                 throws com.ebasetech.xi.exceptions.FormRuntimeException
Sends the email message as specified in the email resource together with any attachments. Any substitutable fields in the email resource are replaced with values from mapped form fields.

If a failure occurs, behaviour depends on the setting of the Success of this Email is critical checkbox in the email resource:

This method supports file attachments. Parameter attachmentFilePaths is an array that specifies a number of file paths for files to be attached to the email.

Further documentation.

Javascript example:

 var fileAttachments = [ fields.FILE1.value, fields.FILE2.value ];
 var emailOk = resources.EM1.sendmail(fileAttachments);
 if (!emailOk)
  ....
 

Parameters:
attachmentFilePaths - an array of file paths for files to be attached to the email
Returns:
false if there is a failure and the email resource is not marked as critical (see above), otherwise returns true.
Throws:
com.ebasetech.xi.exceptions.FormRuntimeException - if any error occurs during execution and the email resource is marked as critical (see above)
Since:
V4.4
See Also:
sendmail(), sendmail(String[], Map)

sendmail

boolean sendmail(java.lang.String[] attachmentFilePaths,
                 java.util.Map<java.lang.String,java.lang.String> attachmentTexts)
                 throws com.ebasetech.xi.exceptions.FormRuntimeException
Sends the email message as specified in the email resource together with any attachments. Any substitutable fields in the email resource are replaced with values from mapped form fields.

If a failure occurs, behaviour depends on the setting of the Success of this Email is critical checkbox in the email resource:

Attachments can be added to the email if two ways: Further documentation.

Javascript example 1 (inline attachment):

 var inlineAttachments = {};
 inlineAttachments.attachment1Name = "This is an email attachment";
 resources.EM1.sendmail(null, inlineAttachments);
 

Javascript example 2 (inline and file attachments):

 var inlineAttachments = {};
 inlineAttachments.attachment1Name = "This is an email attachment";
 var fileAttachments = [ fields.FILE1.value, fields.FILE2.value ];
 resources.EM1.sendmail(fileAttachments, inlineAttachments);
 

Parameters:
attachmentFilePaths - an array of file paths for files to be attached to the email
attachmentTexts - a Map specifying inline (String) attachments, see above
Returns:
false if there is a failure and the email resource is not marked as critical (see above), otherwise returns true.
Throws:
com.ebasetech.xi.exceptions.FormRuntimeException - if any error occurs during execution and the email resource is marked as critical (see above)
Since:
V4.4
See Also:
sendmail(), sendmail(String[])