Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into issue-12428
Browse files Browse the repository at this point in the history
  • Loading branch information
michelle0927 committed Jun 17, 2024
2 parents f88ae1e + c40f0cd commit 56dd48a
Show file tree
Hide file tree
Showing 55 changed files with 2,142 additions and 50 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/components-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/[email protected].6
- uses: actions/[email protected].7
name: Checkout repo
with:
# See https://github.com/actions/checkout#checkout-v2
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/[email protected].6
uses: actions/[email protected].7
- uses: pnpm/[email protected]
with:
version: 7.33.6
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/[email protected].6
uses: actions/[email protected].7
- uses: pnpm/[email protected]
with:
version: 7.33.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected].6
- uses: actions/[email protected].7
name: Checkout repo
with:
# See https://github.com/actions/checkout#checkout-v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected].6
uses: actions/[email protected].7
- uses: pnpm/[email protected]
with:
version: 7.33.6
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/[email protected].6
uses: actions/[email protected].7
- uses: pnpm/[email protected]
with:
version: 7.33.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-marketplace-content.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected].6
uses: actions/[email protected].7
- uses: pnpm/[email protected]
with:
version: 7.33.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/[email protected].6
- uses: actions/[email protected].7
- uses: pnpm/[email protected]
with:
version: 7.33.6
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected].6
- uses: actions/[email protected].7
name: Checkout
- uses: Ana06/[email protected]
id: changed_files
Expand All @@ -35,7 +35,7 @@ jobs:
done
echo "files=${files}" >> $GITHUB_ENV
- uses: rojopolis/spellcheck-github-actions@0.37.0
- uses: rojopolis/spellcheck-github-actions@0.38.0
name: Spellcheck
if: ${{ env.files }}
with:
Expand All @@ -48,7 +48,7 @@ jobs:

steps:
- name: Checkout Code
uses: actions/[email protected].6
uses: actions/[email protected].7
with:
# Full git history is needed to get a proper list of changed files
# within `super-linter`
Expand Down
77 changes: 77 additions & 0 deletions components/acymailing/actions/add-update-user/add-update-user.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import acymailing from "../../acymailing.app.mjs";
import { parseObject } from "../../common/utils.mjs";

export default {
key: "acymailing-add-update-user",
name: "Add or Update User",
description: "Creates a new user or updates an existing user in AcyMailing. If the user exists, will update the user's data with provided information. [See the documentation](https://docs.acymailing.com/v/rest-api/users#create-or-update-a-user)",
version: "0.0.1",
type: "action",
props: {
acymailing,
email: {
type: "string",
label: "Email",
description: "The email address is used when updating an existing user.",
},
name: {
type: "string",
label: "Name",
description: "Any character should be available.",
optional: true,
},
active: {
type: "boolean",
label: "Active",
description: "Defaults to true.",
optional: true,
},
confirmed: {
type: "boolean",
label: "Confirmed",
description: "The confirmation is related to the \"Require confirmation\" option in the configuration, tab \"Subscription\".",
optional: true,
},
cmsId: {
type: "integer",
label: "CMS Id",
description: "The cms_id must match the ID of the corresponding Joomla/WordPress user.",
optional: true,
},
customFields: {
type: "object",
label: "Custom Fields",
description: "An object of field Ids and values.",
optional: true,
},
triggers: {
type: "boolean",
label: "Triggers",
description: "Defaults to true. Defines if the saving of the user triggers automated tasks like follow-up campaigns and automations.",
optional: true,
},
sendConf: {
type: "boolean",
label: "Send Conf",
description: "Defaults to true. Defines if the confirmation email should be sent when a new user is created.",
optional: true,
},
},
async run({ $ }) {
const response = await this.acymailing.createUserOrUpdate({
$,
data: {
email: this.email,
name: this.name,
active: this.active,
confirmed: this.confirmed,
cmsId: this.cmsId,
customFields: parseObject(this.customFields),
triggers: this.triggers,
sendConf: this.sendConf,
},
});
$.export("$summary", `Successfully added or updated user with email with Id: ${response.userId}`);
return response;
},
};
55 changes: 55 additions & 0 deletions components/acymailing/actions/email-user/email-user.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import acymailing from "../../acymailing.app.mjs";
import { parseObject } from "../../common/utils.mjs";

export default {
key: "acymailing-email-user",
name: "Email User",
description: "Sends an email to a single AcyMailing user. The user must exist in the AcyMailing database. [See the documentation](https://docs.acymailing.com/v/rest-api/emails#send-an-email-to-a-user)",
version: "0.0.1",
type: "action",
props: {
acymailing,
email: {
type: "string",
label: "Email",
description: "The email address of the receiver.",
},
autoAddUser: {
type: "boolean",
label: "Auto Add User",
description: "Defaults to false. If the email address doesn't match an existing AcyMailing user, one will be automatically created if this option is set to true.",
optional: true,
},
emailId: {
type: "integer",
label: "Email Id",
description: "The mail ID to send. This is not a campaign ID but the mail ID of the table xxx_acym_mail in the database, or the mail_id of a campaign.",
},
trackEmail: {
type: "boolean",
label: "Track Email",
description: "Defaults to true. If true, the open/click statistics will be collected for this email.",
optional: true,
},
params: {
type: "object",
label: "Params",
description: "An object of shortcodes and values to replace in the body of the sent email. Example: { \"shortcode1\": \"value 1\" }. If the body of the sent email contains the text \"{shortcode1}\", it will be replaced by \"value 1\" in the sent version.",
optional: true,
},
},
async run({ $ }) {
const response = await this.acymailing.sendEmailToUser({
$,
data: {
email: this.email,
autoAddUser: this.autoAddUser,
emailId: this.emailId,
trackEmail: this.trackEmail,
params: parseObject(this.params),
},
});
$.export("$summary", `Email successfully sent to ${this.email}`);
return response;
},
};
51 changes: 51 additions & 0 deletions components/acymailing/actions/subscribe-user/subscribe-user.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import acymailing from "../../acymailing.app.mjs";
import { parseObject } from "../../common/utils.mjs";

export default {
key: "acymailing-subscribe-user",
name: "Subscribe User to Lists",
description: "Subscribes a user to one or more specified lists in AcyMailing. [See the documentation](https://docs.acymailing.com/v/rest-api/subscription#subscribe-users-to-lists)",
version: "0.0.1",
type: "action",
props: {
acymailing,
emails: {
propDefinition: [
acymailing,
"emails",
],
},
listIds: {
propDefinition: [
acymailing,
"listIds",
],
},
sendWelcomeEmail: {
type: "boolean",
label: "Send Welcome Email",
description: "Defaults to true. If true, the welcome emails will be sent if the lists have one.",
optional: true,
},
trigger: {
type: "boolean",
label: "Trigger",
description: "Defaults to true. If you want to trigger or not the automation or follow-up when subscribing the user.",
optional: true,
},
},
async run({ $ }) {
const response = await this.acymailing.subscribeUserToLists({
$,
data: {
emails: parseObject(this.emails),
listIds: parseObject(this.listIds),
sendWelcomeEmail: this.sendWelcomeEmail,
trigger: this.trigger,
},
});

$.export("$summary", `Successfully subscribed ${this.emails.length} users to lists ${this.listIds.length} lists`);
return response;
},
};
Loading

0 comments on commit 56dd48a

Please sign in to comment.