Send & Receive Masked Email Messages
Email Mask addresses automatically route email messages to and from the user's real email address they have chosen to associate with the mask via the verification process.
Internal Email Masks
Inbound Message Receiving
Outbound Message Sending
// Collect the input headers, body, attachments and sender email mask id
// however makes sense for your implementation.
const senderEmailMaskId: string = emailMask.id
const emailMessageHeader: InternetMessageFormatHeader = {
from: { emailAddress: "from@bar.com" }, // Must match emailMask.maskAddress
to: [{ emailAddress: "to@bar.com" }],
cc: [{ emailAddress: "cc@bar.com" }],
bcc: [{ emailAddress: "bcc@bar.com" }],
replyTo: [{ emailAddress: "replyTo@bar.com" }],
subject: "Example subject line",
}
const emailAttachment: EmailAttachment = {
filename: "fooAttachment.pdf",
contentId: uuid.v4(),
mimeType: "application/pdf",
inlineAttachment: false,
data: // ... Some pdf data
}
const inlineAttachment: EmailAttachment = {
filename: "fooImage.png",
contentId: uuid.v4(),
mimeType: "image/png",
inlineAttachment: true,
data: // ... Some image data
}
try {
const input: SendMaskedEmailMessageInput = {
senderEmailMaskId: senderEmailMaskId,
emailMessageHeaders: emailMessageHeader,
body: "An example email body",
attachments: [emailAttachment],
inlineAttachments: [inlineAttachment],
}
const result = await emailClient.sendMaskedEmailMessage(input)
// `result` contains the identifier and created timestamp associated with the sent email message. You can use this to access the data of the email message.
} catch {
// Handle/notify user of error
}
External Email Masks
Inbound Message Receiving
Outbound Message Sending
Last updated