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.3 KB
Raw Blame
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod } from '@activepieces/pieces-common';
import { resendAuth } from '../..';
import { resendClient } from '../common/client';
import { getEmailStatusOutputSchema } from '../output-schemas';

export const getEmailStatus = createAction({
  name: 'get_email_status',
  classification: 'READ',
  auth: resendAuth,
  displayName: 'Get Email Status',
  outputSchema: getEmailStatusOutputSchema,
  description: 'Retrieve the delivery status of a sent email',
  audience: 'both',
  aiMetadata: { description: 'Looks up the current delivery status and details of a single previously sent email by its Resend email ID. Use this to check whether a specific email was delivered, bounced, or is still scheduled. Read-only and idempotent; requires the email ID returned when the email was sent.', idempotent: true },
  props: {
    email_id: Property.ShortText({
      displayName: 'Email ID',
      description: 'The ID returned by Send Email or List Sent Emails.',
      placeholder: '4ef9a417-02e9-4d39-ad75-9611e0fcc33c',
      required: true,
    }),
  },
  async run({ auth, propsValue }) {
    return await resendClient.sendRequest({ auth: auth.secret_text, method: HttpMethod.GET, path: `/emails/${propsValue.email_id}` });
  },
});