Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@larabr
Copy link
Contributor

@larabr larabr commented Oct 28, 2021

This adds an include_attachments option to get_messages. If set, an attachments field is included in the returned email object, containing an entry for each attachment, of the form { data: string, filename: string, mimeType: string }. The data is left encoded as base64.

Copy link
Owner

@levz0r levz0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution for this useful feature. Please See my comments.

}
} else {
let { parts } = gmail_email.payload;
const parts = [...gmail_email.payload.parts];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, parts can't be const because there is an assignment to parts on line 77.


if (options.include_attachments) {
const parts = gmail_email.payload.parts || [];
const attachmentInfos = parts.filter(part => part.body.size && part.body.attachmentId)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use underscore naming convention (e.g attachment_infos)?

@levz0r levz0r merged commit 5215f5e into levz0r:master Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants