diff --git a/components/gmail/actions/add-label-to-email/add-label-to-email.mjs b/components/gmail/actions/add-label-to-email/add-label-to-email.mjs index 774105970de27..a53aa8b49f7f7 100644 --- a/components/gmail/actions/add-label-to-email/add-label-to-email.mjs +++ b/components/gmail/actions/add-label-to-email/add-label-to-email.mjs @@ -4,7 +4,7 @@ export default { key: "gmail-add-label-to-email", name: "Add Label to Email", description: "Add label(s) to an email message. [See the docs](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/modify)", - version: "0.0.7", + version: "0.0.8", type: "action", props: { gmail, diff --git a/components/gmail/actions/approve-workflow/approve-workflow.mjs b/components/gmail/actions/approve-workflow/approve-workflow.mjs index caaf2062b2a45..319d7e2830fa6 100644 --- a/components/gmail/actions/approve-workflow/approve-workflow.mjs +++ b/components/gmail/actions/approve-workflow/approve-workflow.mjs @@ -4,7 +4,7 @@ export default { key: "gmail-approve-workflow", name: "Approve Workflow", description: "Suspend the workflow until approved by email. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { gmail, diff --git a/components/gmail/actions/archive-email/archive-email.mjs b/components/gmail/actions/archive-email/archive-email.mjs index a1bca2ae6aa00..34c90f35a2256 100644 --- a/components/gmail/actions/archive-email/archive-email.mjs +++ b/components/gmail/actions/archive-email/archive-email.mjs @@ -5,7 +5,7 @@ export default { key: "gmail-archive-email", name: "Archive Email", description: "Archive an email message. [See the documentation](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/modify)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { gmail, diff --git a/components/gmail/actions/create-draft/create-draft.mjs b/components/gmail/actions/create-draft/create-draft.mjs index 7b1d4c0f41407..18e9b717a3c55 100644 --- a/components/gmail/actions/create-draft/create-draft.mjs +++ b/components/gmail/actions/create-draft/create-draft.mjs @@ -6,7 +6,7 @@ export default { key: "gmail-create-draft", name: "Create Draft", description: "Create a draft from your Google Workspace email account. [See the documentation](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)", - version: "0.1.0", + version: "0.1.1", type: "action", props: { gmail, diff --git a/components/gmail/actions/download-attachment/download-attachment.mjs b/components/gmail/actions/download-attachment/download-attachment.mjs index bdb1ae995b04e..8361bf420a008 100644 --- a/components/gmail/actions/download-attachment/download-attachment.mjs +++ b/components/gmail/actions/download-attachment/download-attachment.mjs @@ -7,7 +7,7 @@ export default { key: "gmail-download-attachment", name: "Download Attachment", description: "Download an attachment by attachmentId to the /tmp directory. [See the documentation](https://developers.google.com/gmail/api/reference/rest/v1/users.messages.attachments/get)", - version: "0.0.5", + version: "0.0.6", type: "action", props: { gmail, diff --git a/components/gmail/actions/find-email/find-email.mjs b/components/gmail/actions/find-email/find-email.mjs index 99198585f9e3b..b414a3ee858da 100644 --- a/components/gmail/actions/find-email/find-email.mjs +++ b/components/gmail/actions/find-email/find-email.mjs @@ -4,7 +4,7 @@ export default { key: "gmail-find-email", name: "Find Email", description: "Find an email using Google's Search Engine. [See the docs](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)", - version: "0.0.10", + version: "0.0.11", type: "action", props: { gmail, diff --git a/components/gmail/actions/list-labels/list-labels.mjs b/components/gmail/actions/list-labels/list-labels.mjs index 4d2ba114eb0bc..51db38f79d42f 100644 --- a/components/gmail/actions/list-labels/list-labels.mjs +++ b/components/gmail/actions/list-labels/list-labels.mjs @@ -4,7 +4,7 @@ export default { key: "gmail-list-labels", name: "List Labels", description: "List all the existing labels in the connected account. [See the docs](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { gmail, diff --git a/components/gmail/actions/remove-label-from-email/remove-label-from-email.mjs b/components/gmail/actions/remove-label-from-email/remove-label-from-email.mjs index 54db833a26298..00ac1b92c50c5 100644 --- a/components/gmail/actions/remove-label-from-email/remove-label-from-email.mjs +++ b/components/gmail/actions/remove-label-from-email/remove-label-from-email.mjs @@ -4,7 +4,7 @@ export default { key: "gmail-remove-label-from-email", name: "Remove Label from Email", description: "Remove label(s) from an email message. [See the docs](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/modify)", - version: "0.0.4", + version: "0.0.5", type: "action", props: { gmail, diff --git a/components/gmail/actions/send-email/send-email.mjs b/components/gmail/actions/send-email/send-email.mjs index df92f2bbc8c0e..d12a016fbf665 100644 --- a/components/gmail/actions/send-email/send-email.mjs +++ b/components/gmail/actions/send-email/send-email.mjs @@ -6,7 +6,7 @@ export default { key: "gmail-send-email", name: "Send Email", description: "Send an email from your Google Workspace email account. [See the documentation](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { gmail, @@ -84,6 +84,7 @@ export default { label: "In Reply To", description: "Specify the `message-id` this email is replying to.", optional: true, + reloadProps: true, }, mimeType: { propDefinition: [ @@ -92,6 +93,22 @@ export default { ], }, }, + additionalProps(existingProps) { + const props = {}; + if (this.inReplyTo) { + props.replyAll = { + type: "boolean", + label: "Reply All", + description: "Set to `true` to send reply to emails in the \"From\", \"To\", \"CC\", and \"BCC\" (if available) of the original email", + optional: true, + reloadProps: true, + }; + } + existingProps.to.hidden = !!this.replyAll; + existingProps.cc.hidden = !!this.replyAll; + existingProps.bcc.hidden = !!this.replyAll; + return props; + }, async run({ $ }) { this.attachmentFilenames = utils.parseArray(this.attachmentFilenames); this.attachmentUrlsOrPaths = utils.parseArray(this.attachmentUrlsOrPaths); @@ -100,7 +117,7 @@ export default { } const opts = await this.gmail.getOptionsToSendEmail($, this); const response = await this.gmail.sendEmail(opts); - $.export("$summary", `Successfully sent email to ${this.to}`); + $.export("$summary", "Successfully sent the email"); return response; }, }; diff --git a/components/gmail/actions/update-org-signature/update-org-signature.mjs b/components/gmail/actions/update-org-signature/update-org-signature.mjs index 4b3a87d8949c9..210ad56e87c68 100644 --- a/components/gmail/actions/update-org-signature/update-org-signature.mjs +++ b/components/gmail/actions/update-org-signature/update-org-signature.mjs @@ -8,7 +8,7 @@ export default { name: "Update Signature for Email in Organization", description: `Update the signature for a specific email address in an organization. A Google Cloud service account with delegated domain-wide authority is required for this action. [See the documentation](https://developers.google.com/gmail/api/reference/rest/v1/users.settings.sendAs/update)`, - version: "0.0.5", + version: "0.0.6", type: "action", props: { gmail, diff --git a/components/gmail/actions/update-primary-signature/update-primary-signature.mjs b/components/gmail/actions/update-primary-signature/update-primary-signature.mjs index 256c6dab14371..80913f2810fa2 100644 --- a/components/gmail/actions/update-primary-signature/update-primary-signature.mjs +++ b/components/gmail/actions/update-primary-signature/update-primary-signature.mjs @@ -4,7 +4,7 @@ export default { key: "gmail-update-primary-signature", name: "Update Signature for Primary Email Address", description: "Update the signature for the primary email address. [See the documentation](https://developers.google.com/gmail/api/reference/rest/v1/users.settings.sendAs/update)", - version: "0.0.5", + version: "0.0.6", type: "action", props: { gmail, diff --git a/components/gmail/gmail.app.mjs b/components/gmail/gmail.app.mjs index 73b3e7baee7e7..6a4747dbdea60 100644 --- a/components/gmail/gmail.app.mjs +++ b/components/gmail/gmail.app.mjs @@ -303,6 +303,35 @@ export default { opts.inReplyTo = inReplyTo; opts.references = inReplyTo; opts.threadId = repliedMessage.threadId; + if (props.replyAll) { + const from = repliedMessage.payload.headers.find(({ name }) => name.toLowerCase() === "from"); + const to = repliedMessage.payload.headers.find(({ name }) => name.toLowerCase() === "to"); + const cc = repliedMessage.payload.headers.find(({ name }) => name.toLowerCase() === "cc"); + const bcc = repliedMessage.payload.headers.find(({ name }) => name.toLowerCase() === "bcc"); + opts.to = from.value.split(","); + opts.to.push(...to.value.split(",")); + + // Filter out the current user's email address + const currentUserEmail = email.toLowerCase().trim(); + opts.to = opts.to.filter((addr) => { + // Extract email from possible format like "Name " + const match = addr.match(/<(.+?)>/) || [ + null, + addr.trim(), + ]; + return match[1].toLowerCase() !== currentUserEmail; + }); + + opts.to = [ + ...new Set(opts.to), + ]; + if (cc) { + opts.cc = cc.value; + } + if (bcc) { + opts.bcc = bcc.value; + } + } } catch (err) { opts.threadId = props.inReplyTo; } diff --git a/components/gmail/package.json b/components/gmail/package.json index f2507ae772f5e..03b95c7532611 100644 --- a/components/gmail/package.json +++ b/components/gmail/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/gmail", - "version": "0.3.1", + "version": "0.3.2", "description": "Pipedream Gmail Components", "main": "gmail.app.mjs", "keywords": [ diff --git a/components/gmail/sources/common/base.mjs b/components/gmail/sources/common/base.mjs index fcd3d7714119b..6054c37c7d3dd 100644 --- a/components/gmail/sources/common/base.mjs +++ b/components/gmail/sources/common/base.mjs @@ -75,6 +75,8 @@ export default { "subject": this.getHeaderValue(headers, "subject"), "from": this.parseEmail(this.getHeaderValue(headers, "from")), "to": this.parseEmail(this.getHeaderValue(headers, "to")), + "cc": this.parseEmail(this.getHeaderValue(headers, "cc")), + "bcc": this.parseEmail(this.getHeaderValue(headers, "bcc")), "reply-to": this.parseEmail(this.getHeaderValue(headers, "reply-to")), "date": this.getHeaderValue(headers, "date"), "snippet": msg.snippet, diff --git a/components/gmail/sources/new-attachment-received/new-attachment-received.mjs b/components/gmail/sources/new-attachment-received/new-attachment-received.mjs index 3c38a79281c37..7000221bd2a91 100644 --- a/components/gmail/sources/new-attachment-received/new-attachment-received.mjs +++ b/components/gmail/sources/new-attachment-received/new-attachment-received.mjs @@ -6,7 +6,7 @@ export default { key: "gmail-new-attachment-received", name: "New Attachment Received", description: "Emit new event for each attachment in a message received. This source is capped at 100 max new messages per run.", - version: "0.0.10", + version: "0.0.11", type: "source", dedupe: "unique", props: { diff --git a/components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs b/components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs index 24075d0246749..933b22fd3f122 100644 --- a/components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs +++ b/components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs @@ -6,7 +6,7 @@ export default { key: "gmail-new-email-matching-search", name: "New Email Matching Search", description: "Emit new event when an email matching the search criteria is received. This source is capped at 100 max new messages per run.", - version: "0.0.8", + version: "0.0.9", type: "source", dedupe: "unique", props: { diff --git a/components/gmail/sources/new-email-received/new-email-received.mjs b/components/gmail/sources/new-email-received/new-email-received.mjs index a1d845deaf65f..55b554f72604b 100644 --- a/components/gmail/sources/new-email-received/new-email-received.mjs +++ b/components/gmail/sources/new-email-received/new-email-received.mjs @@ -15,7 +15,7 @@ export default { name: "New Email Received", description: "Emit new event when a new email is received.", type: "source", - version: "0.2.3", + version: "0.2.4", dedupe: "unique", props: { gmail, diff --git a/components/gmail/sources/new-labeled-email/new-labeled-email.mjs b/components/gmail/sources/new-labeled-email/new-labeled-email.mjs index e1aeb6616f517..7c4d6d07c23d3 100644 --- a/components/gmail/sources/new-labeled-email/new-labeled-email.mjs +++ b/components/gmail/sources/new-labeled-email/new-labeled-email.mjs @@ -8,7 +8,7 @@ export default { name: "New Labeled Email", description: "Emit new event when a new email is labeled.", type: "source", - version: "0.0.10", + version: "0.0.11", dedupe: "unique", props: { gmail, diff --git a/components/gmail/sources/new-sent-email/new-sent-email.mjs b/components/gmail/sources/new-sent-email/new-sent-email.mjs index 7670870d567d4..6ee834f3a9642 100644 --- a/components/gmail/sources/new-sent-email/new-sent-email.mjs +++ b/components/gmail/sources/new-sent-email/new-sent-email.mjs @@ -6,7 +6,7 @@ export default { key: "gmail-new-sent-email", name: "New Sent Email", description: "Emit new event for each new email sent. (Maximum of 100 events emited per execution)", - version: "0.0.9", + version: "0.0.10", type: "source", dedupe: "unique", props: { diff --git a/components/oto/oto.app.mjs b/components/oto/oto.app.mjs index 609c687ba4622..41dbdb91de0be 100644 --- a/components/oto/oto.app.mjs +++ b/components/oto/oto.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/test_apps_for_checking_something_005/test_apps_for_checking_something_005.app.mjs b/components/test_apps_for_checking_something_005/test_apps_for_checking_something_005.app.mjs index 163d41602fd02..9915885b78593 100644 --- a/components/test_apps_for_checking_something_005/test_apps_for_checking_something_005.app.mjs +++ b/components/test_apps_for_checking_something_005/test_apps_for_checking_something_005.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/test_apps_for_checking_something_006/test_apps_for_checking_something_006.app.mjs b/components/test_apps_for_checking_something_006/test_apps_for_checking_something_006.app.mjs index c913df140c4f6..3df0f21d225fd 100644 --- a/components/test_apps_for_checking_something_006/test_apps_for_checking_something_006.app.mjs +++ b/components/test_apps_for_checking_something_006/test_apps_for_checking_something_006.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/transloadit/transloadit.app.mjs b/components/transloadit/transloadit.app.mjs index 11044c01ae4ab..da1748d53899e 100644 --- a/components/transloadit/transloadit.app.mjs +++ b/components/transloadit/transloadit.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0248a3592dd6a..b74ba3c50a08c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9221,8 +9221,7 @@ importers: components/osu: {} - components/oto: - specifiers: {} + components/oto: {} components/otter_waiver: dependencies: @@ -13062,11 +13061,9 @@ importers: components/test_apps_for_checking_something_001: {} - components/test_apps_for_checking_something_005: - specifiers: {} + components/test_apps_for_checking_something_005: {} - components/test_apps_for_checking_something_006: - specifiers: {} + components/test_apps_for_checking_something_006: {} components/test_apps_for_switching_appslug_009: {} @@ -13440,8 +13437,7 @@ importers: components/translate_com: {} - components/transloadit: - specifiers: {} + components/transloadit: {} components/travis_ci: dependencies: