Package 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.
 - Since:
 - V4.4
 
- 
Method Summary
Modifier and Type Method Description booleansendmail()Sends the email message as specified in the email resource.booleansendmail(java.lang.String[] attachmentFilePaths)Sends the email message as specified in the email resource together with any attachments.booleansendmail(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 Details
- 
sendmail
boolean sendmail() throws com.ebasetech.xi.exceptions.FormRuntimeExceptionSends 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:
- checked - a FormException is thrown
 - unchecked - returns false
 
- 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.FormRuntimeExceptionSends 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:
- checked - a FormException is thrown
 - unchecked - returns false
 
attachmentFilePathsis an array that specifies a number of file paths for files to be attached to the email.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.FormRuntimeExceptionSends 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:
- checked - a FormException is thrown
 - unchecked - returns false
 
- As files. Parameter 
attachmentFilePathsis an array that specifies a number of file paths for files to be attached to the email. - As strings. Parameter 
attachmentTextsis a Map that provides a way of specifying attachments using strings. Map keys are treated as attachment names and the corresponding values form the attachments. 
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 emailattachmentTexts- 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[])
 
 -