Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "sendgrid-add-email-to-global-suppression",
name: "Add Email to Global Suppression",
description: "Allows you to add one or more email addresses to the global suppressions group. [See the docs here](https://sendgrid.api-docs.io/v3.0/suppressions-global-suppressions/add-recipient-addresses-to-the-global-suppression-group)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "sendgrid-add-or-update-contact",
name: "Add or Update Contact",
description: "Adds or updates a contact. [See the docs here](https://docs.sendgrid.com/api-reference/contacts/add-or-update-a-contact)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
7 changes: 6 additions & 1 deletion components/sendgrid/actions/common/common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ export default {
}
return asmConfig;
},

checkTmp(filename) {
if (!filename.startsWith("/tmp")) {
return `/tmp/${filename}`;
}
return filename;
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "sendgrid-create-contact-list",
name: "Create Contact List",
description: "Allows you to create a new contact list. [See the docs here](https://docs.sendgrid.com/api-reference/lists/create-list)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/sendgrid/actions/create-send/create-send.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "sendgrid-create-send",
name: "Create Send",
description: "Create a single send. [See the docs here](https://www.twilio.com/docs/sendgrid/api-reference/single-sends/create-single-send)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "sendgrid-delete-blocks",
name: "Delete Blocks",
description: "Allows you to delete all email addresses on your blocks list. [See the docs here](https://docs.sendgrid.com/api-reference/blocks-api/delete-blocks)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "sendgrid-delete-bounces",
name: "Delete Bounces",
description: "Allows you to delete all emails on your bounces list. [See the docs here](https://docs.sendgrid.com/api-reference/bounces-api/delete-bounces)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "sendgrid-delete-contacts",
name: "Delete Contacts",
description: "Allows you to delete one or more contacts. [See the docs here](https://docs.sendgrid.com/api-reference/contacts/delete-contacts)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "sendgrid-delete-global-suppression",
name: "Delete Global Suppression",
description: "Allows you to remove an email address from the global suppressions group. [See the docs here](https://docs.sendgrid.com/api-reference/suppressions-global-suppressions/delete-a-global-suppression)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/sendgrid/actions/delete-list/delete-list.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "sendgrid-delete-list",
name: "Delete List",
description: "Allows you to delete a specific contact list. [See the docs here](https://docs.sendgrid.com/api-reference/lists/delete-a-list)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/sendgrid/actions/get-a-block/get-a-block.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "sendgrid-get-a-block",
name: "Get a Block",
description: "Gets a specific block. [See the docs here](https://docs.sendgrid.com/api-reference/blocks-api/retrieve-a-specific-block)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "sendgrid-get-a-global-suppression",
name: "Get A Global Suppression",
description: "Gets a global suppression. [See the docs here](https://docs.sendgrid.com/api-reference/suppressions-global-suppressions/retrieve-a-global-suppression)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "sendgrid-get-all-bounces",
name: "Get All Bounces",
description: "Allows you to get all of your bounces. [See the docs here](https://docs.sendgrid.com/api-reference/bounces-api/retrieve-all-bounces)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "sendgrid-get-contact-lists",
name: "Get Contact Lists",
description: "Allows you to get details of your contact lists. [See the docs here](https://docs.sendgrid.com/api-reference/lists/get-all-lists)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/sendgrid/actions/list-blocks/list-blocks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "sendgrid-list-blocks",
name: "List Blocks",
description: "Allows you to list all email addresses that are currently on your blocks list. [See the docs here](https://docs.sendgrid.com/api-reference/blocks-api/retrieve-all-blocks)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "sendgrid-list-global-suppressions",
name: "List Global Suppressions",
description: "Allows you to get a list of all email address that are globally suppressed. [See the docs here](https://docs.sendgrid.com/api-reference/suppressions-global-suppressions/retrieve-all-global-suppressions)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "sendgrid-remove-contact-from-list",
name: "Remove Contact From List",
description: "Allows you to remove contacts from a given list. [See the docs here](https://docs.sendgrid.com/api-reference/lists/remove-contacts-from-a-list)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "sendgrid-search-contacts",
name: "Search Contacts",
description: "Searches contacts with a SGQL query. [See the docs here](https://docs.sendgrid.com/api-reference/contacts/search-contacts)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from "fs";
import validate from "validate.js";
import common from "../common/common.mjs";

Expand All @@ -6,7 +7,7 @@ export default {
key: "sendgrid-send-email-multiple-recipients",
name: "Send Email Multiple Recipients",
description: "This action sends a personalized e-mail to multiple specified recipients. [See the docs here](https://docs.sendgrid.com/api-reference/mail-send/mail-send)",
version: "0.0.5",
version: "0.0.6",
type: "action",
props: {
...common.props,
Expand Down Expand Up @@ -186,6 +187,16 @@ export default {
},
};
attachments = this.getArrayObject(this.attachments);
attachments.map((attachment) => {
if (attachment.filepath) {
const filepath = this.checkTmp(attachment.filepath);
attachment.content = fs.readFileSync(filepath, {
encoding: "base64",
});
}
delete attachment.filepath;
return attachment;
});
}
if (this.categories) {
constraints.categories = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from "fs";
import validate from "validate.js";
import common from "../common/common.mjs";

Expand All @@ -6,7 +7,7 @@ export default {
key: "sendgrid-send-email-single-recipient",
name: "Send Email Single Recipient",
description: "This action sends a personalized e-mail to the specified recipient. [See the docs here](https://docs.sendgrid.com/api-reference/mail-send/mail-send)",
version: "0.0.7",
version: "0.0.8",
type: "action",
props: {
...common.props,
Expand Down Expand Up @@ -211,6 +212,16 @@ export default {
},
};
attachments = this.getArrayObject(this.attachments);
attachments.map((attachment) => {
if (attachment.filepath) {
const filepath = this.checkTmp(attachment.filepath);
attachment.content = fs.readFileSync(filepath, {
encoding: "base64",
});
}
delete attachment.filepath;
return attachment;
});
}
if (this.categories) {
constraints.categories = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "sendgrid-validate-email",
name: "Validate Email",
description: "Validates an email address. This action requires a Sendgrid's Pro or Premier plan. [See the docs here](https://docs.sendgrid.com/api-reference/e-mail-address-validation/validate-an-email)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
3 changes: 2 additions & 1 deletion components/sendgrid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/sendgrid",
"version": "0.4.0",
"version": "0.4.1",
"description": "Pipedream Sendgrid Components",
"main": "sendgrid.app.js",
"keywords": [
Expand All @@ -14,6 +14,7 @@
"@sendgrid/client": "^7.6.2",
"@sendgrid/eventwebhook": "^7.4.5",
"async-retry": "^1.3.1",
"fs": "^0.0.1-security",
"lodash": "^4.17.20",
"uuid": "^8.3.2",
"validate.js": "^0.13.1"
Expand Down
2 changes: 1 addition & 1 deletion components/sendgrid/sendgrid.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export default {
attachments: {
type: "string",
label: "Attachments",
description: "An array of objects where you can specify any attachments you want to include. The fields `content` and `filename` are required. `content` must be base64 encoded. Alternatively, provide a string that will `JSON.parse` to an array of attachments objects. Example: `[{content:\"aGV5\",type:\"text/plain\",filename:\"sample.txt\"}]`",
description: "An array of objects where you can specify any attachments you want to include. The fields `content` and `filename` are required. `content` must be base64 encoded. Alternatively, provide a string that will `JSON.parse` to an array of attachments objects. Example: `[{content:\"aGV5\",filepath:\"/tmp/file.txt\",type:\"text/plain\",filename:\"sample.txt\"}]` `You must provide either content in base64 or path to the /temp file`",
optional: true,
},
headers: {
Expand Down
2 changes: 1 addition & 1 deletion components/sendgrid/sources/events/events.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "sendgrid-events",
name: "New Events (Instant)",
description: "Emit new event when any of the specified SendGrid events is received",
version: "0.0.6",
version: "0.0.7",
type: "source",
dedupe: "unique",
props: {
Expand Down
2 changes: 1 addition & 1 deletion components/sendgrid/sources/new-contact/new-contact.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "sendgrid-new-contact",
name: "New Contact",
description: "Emit new event when a new contact is created",
version: "0.0.7",
version: "0.0.8",
type: "source",
dedupe: "unique",
hooks: {
Expand Down
9 changes: 5 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading