Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
@@ -0,0 +1,67 @@
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";

export default {
key: "add_to_calendar_pro-create-event-group",
name: "Create Event Group",
description: "Create an event group. [See the documentation](https://docs.add-to-calendar-pro.com/api/groups#add-a-group)",
version: "0.0.1",
type: "action",
props: {
addToCalendarPro,
eventGroupName: {
propDefinition: [
addToCalendarPro,
"eventGroupName",
],
},
internalNote: {
propDefinition: [
addToCalendarPro,
"internalNote",
],
},
subscriptionCallUrl: {
propDefinition: [
addToCalendarPro,
"subscriptionCallUrl",
],
},
cta: {
propDefinition: [
addToCalendarPro,
"cta",
],
},
styleId: {
propDefinition: [
addToCalendarPro,
"styleId",
],
},
landingPageTemplateId: {
propDefinition: [
addToCalendarPro,
"landingPageTemplateId",
],
optional: true,
},
},
async run({ $ }) {
const response = await this.addToCalendarPro.createGroup({
$,
data: {
name: this.eventGroupName,
internal_note: this.internalNote,
subscription: this.subscriptionCallUrl
? "external"
: "no",
subscription_call_url: this.subscriptionCallUrl,
cta: this.cta,
layout: this.styleId,
landingpage: this.landingPageTemplateId,
},
});
$.export("$summary", "Successfully created event group.");
return response;
},
};
131 changes: 131 additions & 0 deletions components/add_to_calendar_pro/actions/create-event/create-event.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";

export default {
key: "add_to_calendar_pro-create-event",
name: "Create Event",
description: "Create an event in a group. [See the documentation](https://docs.add-to-calendar-pro.com/api/events#add-an-event)",
version: "0.0.1",
type: "action",
props: {
addToCalendarPro,
groupProKey: {
propDefinition: [
addToCalendarPro,
"groupProKey",
],
},
name: {
propDefinition: [
addToCalendarPro,
"eventName",
],
},
startDate: {
propDefinition: [
addToCalendarPro,
"startDate",
],
},
startTime: {
propDefinition: [
addToCalendarPro,
"startTime",
],
},
endDate: {
propDefinition: [
addToCalendarPro,
"endDate",
],
},
endTime: {
propDefinition: [
addToCalendarPro,
"endTime",
],
},
timeZone: {
propDefinition: [
addToCalendarPro,
"timeZone",
],
},
description: {
propDefinition: [
addToCalendarPro,
"description",
],
},
location: {
propDefinition: [
addToCalendarPro,
"location",
],
},
rsvp: {
propDefinition: [
addToCalendarPro,
"rsvp",
],
},
distribution: {
propDefinition: [
addToCalendarPro,
"distribution",
],
},
hideButton: {
propDefinition: [
addToCalendarPro,
"hideButton",
],
},
cta: {
propDefinition: [
addToCalendarPro,
"cta",
],
},
styleId: {
propDefinition: [
addToCalendarPro,
"styleId",
],
},
landingPageTemplateId: {
propDefinition: [
addToCalendarPro,
"landingPageTemplateId",
],
optional: true,
},
},
async run({ $ }) {
const event = await this.addToCalendarPro.createEvent({
$,
data: {
event_group: this.groupProKey,
dates: [
{
name: this.name,
startDate: this.startDate,
startTime: this.startTime,
endDate: this.endDate,
endTime: this.endTime,
timeZone: this.timeZone,
description: this.description,
location: this.location,
},
],
rsvp: this.rsvp,
distribution: this.distribution,
hideButton: this.hideButton,
cta: this.cta,
layout: this.styleId,
landingpage: this.landingPageTemplateId,
},
});
$.export("$summary", "Successfully created event.");
return event;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";

export default {
key: "add_to_calendar_pro-create-landing-page-template",
name: "Create Landing Page Template",
description: "Create a landing page template. [See the documentation](https://docs.add-to-calendar-pro.com/api/landingpages#add-a-landing-page-template)",
version: "0.0.1",
type: "action",
props: {
addToCalendarPro,
name: {
propDefinition: [
addToCalendarPro,
"landingPageTemplateName",
],
},
title: {
propDefinition: [
addToCalendarPro,
"title",
],
},
intro: {
propDefinition: [
addToCalendarPro,
"intro",
],
},
legal: {
propDefinition: [
addToCalendarPro,
"legal",
],
},
highlightColor: {
propDefinition: [
addToCalendarPro,
"highlightColor",
],
},
backgroundColor1: {
propDefinition: [
addToCalendarPro,
"backgroundColor1",
],
},
backgroundColor2: {
propDefinition: [
addToCalendarPro,
"backgroundColor2",
],
},
background: {
propDefinition: [
addToCalendarPro,
"background",
],
},
gradientDirection: {
propDefinition: [
addToCalendarPro,
"gradientDirection",
],
},
imageRepeat: {
propDefinition: [
addToCalendarPro,
"imageRepeat",
],
},
metaTitleOverride: {
propDefinition: [
addToCalendarPro,
"metaTitleOverride",
],
},
metaDescriptionOverride: {
propDefinition: [
addToCalendarPro,
"metaDescriptionOverride",
],
},
},
async run({ $ }) {
const response = await this.addToCalendarPro.createLandingPageTemplate({
$,
data: {
name: this.name,
title: this.title,
intro: this.intro,
legal: this.legal,
highlight_color: this.highlightColor,
background_color_1: this.backgroundColor1,
background_color_2: this.backgroundColor2,
background: this.background,
gradient_direction: this.gradientDirection,
image_repeat: this.imageRepeat,
meta_title_override: this.metaTitleOverride,
meta_description_override: this.metaDescriptionOverride,
},
});
$.export("$summary", "Successfully created landing page template.");
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";
import { parseObject } from "../../common/utils.mjs";

export default {
key: "add_to_calendar_pro-create-rsvp-template",
name: "Create RSVP Template",
description: "Create an RSVP template. [See the documentation](https://docs.add-to-calendar-pro.com/api/rsvp#add-an-rsvp-template)",
version: "0.0.1",
type: "action",
props: {
addToCalendarPro,
rsvpTemplateName: {
propDefinition: [
addToCalendarPro,
"rsvpTemplateName",
],
},
max: {
propDefinition: [
addToCalendarPro,
"rsvpTemplateMax",
],
},
maxPP: {
propDefinition: [
addToCalendarPro,
"rsvpTemplateMaxPP",
],
},
expires: {
propDefinition: [
addToCalendarPro,
"expires",
],
},
maybeOption: {
propDefinition: [
addToCalendarPro,
"maybeOption",
],
},
initialConfirmation: {
propDefinition: [
addToCalendarPro,
"initialConfirmation",
],
},
doi: {
propDefinition: [
addToCalendarPro,
"doi",
],
},
headline: {
propDefinition: [
addToCalendarPro,
"headline",
],
},
text: {
propDefinition: [
addToCalendarPro,
"text",
],
},
fields: {
propDefinition: [
addToCalendarPro,
"fields",
],
},
},
async run({ $ }) {
const response = await this.addToCalendarPro.createRsvpTemplate({
$,
data: {
name: this.rsvpTemplateName,
max: this.max,
maxpp: this.maxPP,
expires: this.expires,
maybe_option: this.maybeOption,
initial_confirmation: this.initialConfirmation,
doi: this.doi,
headline: this.headline,
text: this.text,
fields: parseObject(this.fields),
},
});
$.export("$summary", "Successfully created RSVP template.");
return response;
},
};
Loading
Loading