image

Adds ContentPart.Image to the list of parts.


fun image(url: String)(source)

Adds ContentPart.Image with AttachmentContent.URL content from the provided URL.

Parameters

url

Image URL

Throws

if the URL is not valid or no file in the URL was found.


fun image(path: Path)(source)

Adds ContentPart.Image with AttachmentContent.Binary.Bytes content from the provided local file path.

Parameters

path

Path to local image file

Throws

if the path is not valid, the file does not exist, or is not a regular file.