Skip to main content

core.mailattachment

Home > @medplum/core > MailAttachment

MailAttachment interface​

Email attachment definition. Compatible with nodemailer Mail.Options. Other nodemailer attachment options are ignored by the Medplum server.

Signature:

export interface MailAttachment

Properties​

Property

Modifiers

Type

Description

cid?

readonly

string

(Optional) optional content id for using inline images in HTML message source

content?

readonly

string

(Optional) String contents for the attachment

contentDisposition?

readonly

string

(Optional) optional content disposition type for the attachment, defaults to 'attachment'

contentType?

readonly

string

(Optional) optional content type for the attachment, if not set will be derived from the filename property

encoding?

readonly

string

(Optional) If set and content is string, then encodes the content to a Buffer using the specified encoding. Example values: 'base64', 'hex', 'binary' etc.

filename?

readonly

string | false

(Optional) filename to be reported as the name of the attached file, use of unicode is allowed. If you do not want to use a filename, set this value as false, otherwise a filename is generated automatically

path?

readonly

string

(Optional) A Binary/{id} reference, an HTTPS URL, or a data URI, if you want to stream the file instead of including it (better for larger attachments). Local file paths are not allowed.