Stores and retrieves the HTML and plain text body of an EmailItem, decoupled from where that content is actually kept. A tenant may have its content held directly in the database or in a blob store, and this interface lets callers read and write the content without knowing which backend is in use for a given EmailItem. The active implementation is registered in the root context and reached with the static helper methods on this interface, or by resolving EmailContentService.class from the request context for the instance methods.
Methods
getContent(Long emailItemId)
Returns: EmailContent
Retrieves the stored content for an email item by its ID.
| Parameter | Description |
|---|---|
emailItemId | the ID of the email item to read content for |
getContent(EmailItem emailItem)
Returns: EmailContent
Retrieves the stored content for an email item.
| Parameter | Description |
|---|---|
emailItem | the email item to read content for |
setContent(EmailItem emailItem, String html, String text)
Returns: void
Stores the HTML and text content for an email item in this backend.
| Parameter | Description |
|---|---|
emailItem | the email item whose content is being set |
html | the HTML body to store, or null to leave it unchanged |
text | the plain text body to store, or null to leave it unchanged |