Skip to content

Commit 6a90ec5

Browse files
committed
some adjusts
1 parent 3ff4db2 commit 6a90ec5

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

components/selzy/actions/create-email-message/create-email-message.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ export default {
2626
subject: {
2727
type: "string",
2828
label: "Subject",
29-
description: "String with the letter subject. It may include substitution fields. If you wish to use substitution fields, specify a string within a Pipedream Custom Expression and escape the curly brackets with a backslash. For example: {{ \"Welcome to Our Newsletter, \\{\\{Name\\}\\}!\" }}. The parameter is optional if Template Id is indicated.",
29+
description: "String with the letter subject. It may include substitution fields. If you wish to use substitution fields, specify a string within a Pipedream Custom Expression and escape the curly brackets with a backslash. For example: `{{ \"Welcome to Our Newsletter, \\{\\{Name\\}\\}!\" }}`. The parameter is optional if Template Id is indicated.",
3030
},
3131
body: {
3232
type: "string",
3333
label: "Body",
34-
description: "HTML body of the letter. It may include substitution fields. If you wish to use substitution fields, specify an HTML string within a Pipedream Custom Expression and escape the curly brackets with a backslash. For example: {{ \"<p>Hello \\{\\{Name\\}\\},</p><p>Here is your update.</p>\" }}.. The parameter is optional if **Template Id** or **System Template Id** is indicated.",
34+
description: "HTML body of the letter. It may include substitution fields. If you wish to use substitution fields, specify an HTML string within a Pipedream Custom Expression and escape the curly brackets with a backslash. For example: `{{ \"<p>Hello \\{\\{Name\\}\\},</p><p>Here is your update.</p>\" }}`.",
3535
},
3636
listId: {
3737
propDefinition: [
@@ -42,7 +42,7 @@ export default {
4242
textBody: {
4343
type: "string",
4444
label: "Text Body",
45-
description: "Text body of the letter. It may include substitution fields. If you wish to use substitution fields, specify a text string within a Pipedream Custom Expression and escape the curly brackets with a backslash. For example: {{ \"Hello \\{\\{Name\\}\\},\\nHere is your update.\" }}.",
45+
description: "Text body of the letter. It may include substitution fields. If you wish to use substitution fields, specify a text string within a Pipedream Custom Expression and escape the curly brackets with a backslash. For example: `{{ \"Hello \\{\\{Name\\}\\},\\nHere is your update.\" }}`.",
4646
optional: true,
4747
},
4848
generateText: {

components/selzy/sources/new-campaign/new-campaign.mjs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,26 @@ export default {
2525
_setLastId(lastId) {
2626
this.db.set("lastId", lastId);
2727
},
28-
_getLastDate() {
29-
return this.db.get("lastDate") || "1970-01-01 00:00:00";
30-
},
31-
_setLastDate(lastDate) {
32-
this.db.set("lastDate", lastDate);
33-
},
3428
async emitEvent(maxResults = false) {
3529
const lastId = this._getLastId();
36-
const lastDate = this._getLastDate();
3730

3831
const response = this.selzy.paginate({
3932
fn: this.selzy.getCampaigns,
40-
params: {
41-
from: lastDate,
42-
},
4333
});
4434

4535
let responseArray = [];
4636
for await (const item of response) {
4737
responseArray.push(item);
4838
}
4939

50-
responseArray = responseArray.filter((item) => item.id > lastId);
40+
responseArray = responseArray.filter((item) => item.id > lastId).sort((a, b) => b.id - a.id);
5141

5242
if (responseArray.length) {
53-
responseArray = responseArray.reverse();
54-
5543
if (maxResults && (responseArray.length > maxResults)) {
5644
responseArray.length = maxResults;
5745
}
5846

5947
this._setLastId(responseArray[0].id);
60-
this._setLastDate(responseArray[0].start_time);
6148
}
6249

6350
for (const item of responseArray.reverse()) {

0 commit comments

Comments
 (0)