See: Description
Interface | Description |
---|---|
EmailAddress |
Represents an email address.
|
EmailFileReference |
Represents a file attached to an email.
|
EmailItem |
Represents a single email.
|
EmailProcessor |
Invoked to process an email received by the Vault Email Service.
|
EmailProcessorContext |
Provides access to contextual information exposed in an Email Processor.
|
EmailRecipient |
Represents the recipient of the email.
|
EmailSender |
Represents the sender of the email.
|
EmailService |
A service to interact with emails received by Vault.
|
Enum | Description |
---|---|
EmailBodyType |
Represents the body type of an email.
|
EmailSenderType |
Represents the types of senders from whom an email processor can receive emails.
|
Annotation Type | Description |
---|---|
EmailProcessorInfo |
Indicates a class is an
EmailProcessor . |
EmailProcessor
interface and has the
EmailProcessorInfo
annotation.
Email processors take data from emails and convert it into document, object record, or attachment field values and content. Email processors use:
EmailProcessorContext
to retrieve
EmailItem
s, each of which represents a single
email__sys
record.EmailService
to retrieve the body of an email
as HTML or plain text.DocumentService
to create documents.RecordService
to create object records.DocumentService
to create an
Unclassified document from an email and maps values from an EmailItem
to document field values. The annotation defines the senders from whom the email processor will accept emails and
the label that appears in the Vault Admin UI for the email processor.
@EmailProcessorInfo(allowedSenders = EmailSenderType.VAULT_USERS, label = "Create Unclassified Document")
public class UnclassifiedEmailProcessor implements EmailProcessor {
@Override
public void execute(EmailProcessorContext context) {
EmailItem emailItem = context.getEmailItem();
DocumentService documentService = ServiceLocator.locate(DocumentService.class);
DocumentVersion documentVersion = documentService.newDocument();
documentVersion.setSourceFile(emailItem.getEmailFile());
documentVersion.setValue("name__v", emailItem.getSubject());
documentVersion.setValue("type__v", VaultCollections.asList("undefined__v"));
documentVersion.setValue("lifecycle__v", VaultCollections.asList("unclassified__v"));
documentVersion.setValue("status__v", VaultCollections.asList("unclassified__v"));
documentService.createDocuments(VaultCollections.asList(documentVersion));
}
}
Copyright © Veeva Systems 2017–2021. All rights reserved.