AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import {
createAction,
Property,
} from '@activepieces/pieces-framework';
import { status } from '../api';
import { buildListDropdown } from '../props';
import { sendyAuth, SendyAuthType } from '../auth';
import * as z from 'zod/mini'
import { propsValidation } from '@activepieces/pieces-common';
export const statusAction = createAction({
name: 'get_subscription_status',
classification: 'READ',
auth: sendyAuth,
displayName: 'Get Subscription Status',
description: 'Get the subscription status of a user',
audience: 'both',
aiMetadata: { description: 'Looks up the subscription state (e.g. subscribed, unsubscribed, unconfirmed, bounced, complained) of a subscriber, identified by email, within a specific Sendy list. Use to check whether a contact is on a list before acting. Requires the list and a valid email; read-only and idempotent.', idempotent: true },
props: {
list: Property.Dropdown({
auth: sendyAuth,
displayName: 'List',
description: 'Select the list to get the status from',
required: true,
refreshers: ['auth'],
options: async ({ auth }) =>
await buildListDropdown(auth as SendyAuthType),
}),
email: Property.ShortText({
displayName: 'Email',
description: "The user's email",
required: true,
}),
},
async run(context) {
await propsValidation.validateZod(context.propsValue, {
email: z.string().check(z.email()),
});
return await status(context.auth, {
list_id: context.propsValue.list,
email: context.propsValue.email,
});
},
});