file

Adds Attachment.File to the list of attachments.


fun file(url: String, mimeType: String)(source)

Adds Attachment.File with AttachmentContent.URL content from the provided URL.

Parameters

url

File URL

mimeType

MIME type of the file (e.g., "application/pdf", "text/plain")

Throws

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