Skip to content

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

1.0 KB
Raw Blame
import { createAction } from '@activepieces/pieces-framework';
import { ghostAuth } from '../../auth';
import { ghostProps } from '../../common/ai-props';
import { ghostCommon } from '../../common/client';
import { ghostResource } from '../../common/resources';
import { ghostNewsletterOutputSchema } from '../../output-schemas';

export const ghostGetNewsletter = createAction({
  auth: ghostAuth,
  name: 'ghost_get_newsletter',
  outputSchema: ghostNewsletterOutputSchema,
  classification: 'READ',
  displayName: 'Get Newsletter',
  description: 'Get a newsletter by ID.',
  audience: 'ai',
  aiMetadata: {
    description: 'Returns one newsletter by ID with its slug, status, sender and design settings.',
    idempotent: true,
  },
  props: {
    newsletter_id: ghostProps.id('Newsletter ID', 'The newsletter ID, from List Newsletters.'),
  },
  async run(context) {
    return ghostResource.get(
      context.auth,
      'newsletters',
      ghostCommon.id(context.propsValue.newsletter_id, 'Newsletter ID')
    );
  },
});