Skip to content

Commit

Permalink
per docs-337
Browse files Browse the repository at this point in the history
  • Loading branch information
glosier committed May 2, 2024
1 parent a6dd476 commit fd2b68f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ Create a new `SendEmailRequest` object containing:
- `to`: the email address of your recipients
- an `identifiers` object containing the email and/or `id` of your recipient. If the person you reference by email or ID does not exist, Customer.io creates them.
- a `message_data` object containing properties that you want reference in your message using Liquid.
- You can also send attachments with your message. Use `attach` to encode attachments.
- You can also send attachments with your message with `attach`, but you need to read the file to a buffer (with `fs.readFileSync`, for example); you cannot attach raw, base64-encoded data directly from a variable.

Use `sendEmail` referencing your request to send a transactional message. [Learn more about transactional messages and `SendEmailRequest` properties](https://customer.io/docs/transactional-api).

Expand All @@ -331,6 +331,8 @@ const request = new SendEmailRequest({
});

// (optional) attach a file to your message.
// Note that you need to read the file to a buffer;
// you can't simply attach raw, base64-encoded data.
request.attach("receipt.pdf", fs.readFileSync("receipt.pdf"));

api
Expand Down

0 comments on commit fd2b68f

Please sign in to comment.