Parameter | Description | Example | Gmail settings |
---|---|---|---|
emailProtocol |
Protocol |
|
|
emailSSL |
use SSL (boolean) |
|
|
emailFolderName |
inbox folder name |
|
|
emailHost |
hostname |
|
|
emailPort |
port |
|
|
emailUsername |
user name |
||
emailPassword |
user password |
||
emailBatchSize |
number of fetched emails (Integer) |
see Gmail documentation for more information.
Result is a list of messages.
[
{
"attachments":["DocumentValue":{}],(1)
"messageNumber":7,
"sendDate":"2021-03-18T14:24:55Z",(2)
"receivedDate":"2021-03-18T14:24:55Z",(2)
"subject":"document request [60112]",
"name":"Walter Bates",
"from":"[email protected]",
"body":"<html><body><p>body</p></body></html>",
}
]
-
attachments
is aList<DocumentValue>
-
dates are converted to
java.util.Instant
you can add them to a multiple document process data:
import org.bonitasoft.engine.bpm.document.DocumentValue
def docs= []
mail.each { currentMail->
currentMail.attachments.each {
DocumentValue docValue = it as DocumentValue
docs.add(docValue)
}
}
docs
For contract, convert thme to File
import org.bonitasoft.engine.bpm.document.DocumentValue
def docs= []
mail.each { currentMail->
currentMail.attachments.each {
DocumentValue documentValue = it as DocumentValue
FileInputValue fileInputValue= new FileInputValue(documentValue.fileName ,documentValue.mimeType, documentValue.content)
docs.add(fileInputValue)
}
}
docs