Skip to content

Commit d4d9ae4

Browse files
add text export from base64 (#16211)
1 parent f92efba commit d4d9ae4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

components/gmail/actions/find-email/find-email.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "gmail-find-email",
55
name: "Find Email",
66
description: "Find an email using Google's Search Engine. [See the docs](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)",
7-
version: "0.0.8",
7+
version: "0.0.9",
88
type: "action",
99
props: {
1010
gmail,
@@ -48,6 +48,15 @@ export default {
4848
});
4949
const messageIds = messages.map(({ id }) => id);
5050
const messagesToEmit = await this.gmail.getMessages(messageIds);
51+
52+
for await (const message of messagesToEmit) {
53+
for (const part of message.payload?.parts || []) {
54+
if (part.body.data) {
55+
part.body.text = Buffer.from(part.body.data, "base64").toString("utf-8");
56+
}
57+
}
58+
}
59+
5160
const suffix = messagesToEmit.length === 1
5261
? ""
5362
: "s";

components/gmail/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/gmail",
3-
"version": "0.2.8",
3+
"version": "0.2.9",
44
"description": "Pipedream Gmail Components",
55
"main": "gmail.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)