Skip to content

[Components] Hep Scout - Added new triggers #16444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion components/help_scout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/help_scout",
"version": "0.1.0",
"version": "0.1.1",
"description": "Pipedream Help Scout Components",
"main": "help_scout.app.mjs",
"keywords": [
Expand Down
15 changes: 9 additions & 6 deletions components/help_scout/sources/common/base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ export default {
getExtraData() {
return {};
},
getMetadata(body) {
const ts = Date.parse(new Date());
return {
id: `${body.id}-${ts}`,
summary: this.getSummary(body),
ts: ts,
};
},
},
hooks: {
async activate() {
Expand Down Expand Up @@ -70,12 +78,7 @@ export default {
}
}

const ts = Date.parse(new Date());
this.$emit(body, {
id: body.id,
summary: this.getSummary(body),
ts: ts,
});
this.$emit(body, this.getMetadata(body));

return this.http.respond({
status: 200,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import common from "../common/base.mjs";

export default {
...common,
key: "help_scout-new-agent-reply-instant",
name: "New Agent Reply (Instant)",
description: "Emit new event when an agent replies to a conversation.",
version: "0.0.1",
type: "source",
dedupe: "unique",
methods: {
...common.methods,
getEventType() {
return [
"convo.agent.reply.created",
];
},
getSummary(body) {
const agentName = body.assignee
? `${body.assignee.firstName} ${body.assignee.lastName}`
: "Agent";
return `New agent reply from ${agentName} in conversation: ${body.subject}`;
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
export default {
"id": 1755285700,
"type": "reply",
"folderId": 98775,
"mailboxId": 76544,
"number": 2571,
"status": "active",
"state": "published",
"subject": "Need help with my account",
"preview": "Hello John, I've reviewed the additional information you sent...",
"createdAt": "2025-04-24T13:45:23Z",
"modifiedAt": "2025-04-24T14:35:45Z",
"closedAt": null,
"closedBy": null,
"threadCount": 5,
"source": {
"type": "email",
"via": "agent"
},
"tags": [
"account",
"customer"
],
"primaryCustomer": {
"id": 298473,
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe"
},
"assignee": {
"id": 149254,
"email": "agent@company.com",
"firstName": "Support",
"lastName": "Agent"
},
"cc": [],
"bcc": [],
"threads": [
{
"id": 98254745,
"type": "reply",
"status": "active",
"state": "published",
"author": {
"id": 149254,
"email": "agent@company.com",
"type": "user",
"firstName": "Support",
"lastName": "Agent"
},
"text": "Hello John, I've reviewed the additional information you sent and have updated your account accordingly. Your account settings should now be working as expected. Let me know if you have any other questions!",
"createdAt": "2025-04-24T14:35:45Z"
}
]
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "help_scout-new-conversation-assigned-instant",
name: "New Conversation Assigned (Instant)",
description: "Emit new event when a conversation is assigned to an agent. [See the documentation](https://developer.helpscout.com/)",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "help_scout-new-conversation-created-instant",
name: "New Conversation Created (Instant)",
description: "Emit new event when a new conversation is created.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "help_scout-new-customer-instant",
name: "New Customer Added (Instant)",
description: "Emit new event when a new customer is added.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import common from "../common/base.mjs";

export default {
...common,
key: "help_scout-new-customer-reply-instant",
name: "New Customer Reply (Instant)",
description: "Emit new event when a customer replies to a conversation.",
version: "0.0.1",
type: "source",
dedupe: "unique",
methods: {
...common.methods,
getEventType() {
return [
"convo.customer.reply.created",
];
},
getSummary(body) {
return `New customer reply from ${body.primaryCustomer?.email} in conversation: ${body.subject}`;
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
export default {
"id": 1755285686,
"type": "customer",
"folderId": 98775,
"mailboxId": 76544,
"number": 2571,
"status": "active",
"state": "published",
"subject": "Need help with my account",
"preview": "Hi, I've submitted additional information as requested...",
"createdAt": "2025-04-24T13:45:23Z",
"modifiedAt": "2025-04-24T14:30:12Z",
"closedAt": null,
"closedBy": null,
"threadCount": 4,
"source": {
"type": "email",
"via": "customer"
},
"tags": [
"account",
"customer"
],
"primaryCustomer": {
"id": 298473,
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe"
},
"assignee": {
"id": 149254,
"email": "agent@company.com",
"firstName": "Support",
"lastName": "Agent"
},
"cc": [],
"bcc": [],
"threads": [
{
"id": 98254732,
"type": "customer",
"status": "active",
"state": "published",
"author": {
"id": 298473,
"email": "customer@example.com",
"type": "customer",
"firstName": "John",
"lastName": "Doe"
},
"text": "Hi, I've submitted additional information as requested. Please let me know if you need anything else.",
"createdAt": "2025-04-24T14:30:12Z"
}
]
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import common from "../common/base.mjs";

export default {
...common,
key: "help_scout-new-note-created-instant",
name: "New Note Created (Instant)",
description: "Emit new event when a note is added to a conversation.",
version: "0.0.1",
type: "source",
dedupe: "unique",
methods: {
...common.methods,
getEventType() {
return [
"convo.note.created",
];
},
getSummary(body) {
return `New note created in conversation: ${body.subject}`;
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
export default {
"id": 1755285724,
"type": "note",
"folderId": 98775,
"mailboxId": 76544,
"number": 2571,
"status": "active",
"state": "published",
"subject": "Need help with my account",
"preview": "Internal note: Customer has been having issues since last week...",
"createdAt": "2025-04-24T13:45:23Z",
"modifiedAt": "2025-04-24T14:40:10Z",
"closedAt": null,
"closedBy": null,
"threadCount": 6,
"source": {
"type": "web",
"via": "note"
},
"tags": [
"account",
"customer"
],
"primaryCustomer": {
"id": 298473,
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe"
},
"assignee": {
"id": 149254,
"email": "agent@company.com",
"firstName": "Support",
"lastName": "Agent"
},
"cc": [],
"bcc": [],
"threads": [
{
"id": 98254760,
"type": "note",
"status": "active",
"state": "published",
"author": {
"id": 149254,
"email": "agent@company.com",
"type": "user",
"firstName": "Support",
"lastName": "Agent"
},
"text": "Internal note: Customer has been having issues since last week. I've checked with the product team and this should be resolved with the next update. Don't mention the upcoming update to the customer yet.",
"createdAt": "2025-04-24T14:40:10Z"
}
]
};
Loading