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.4 KB
Raw Blame
import { reoonEmailVerifyAuth } from '../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { verifyEmailsResult } from '../common/send-util';
import { getBulkEmailVerificationResultActionOutputSchema } from '../output-schemas';

export const getBulkEmailVerificationResult = createAction({
  auth: reoonEmailVerifyAuth,
  name: 'get_bulk_email_verification_result',
  classification: 'READ',
  displayName: 'Get Bulk Email Verification Result',
  description: 'Reads the status and results of a bulk verification task.',
  audience: 'ai',
  aiMetadata: {
    description:
      'Reads the current status and verification results of a bulk email verification task by its task_id. The task_id is obtained from the Create Bulk Email Verification action (run that first); poll this until the task reports complete. Read-only — does not change the task or consume additional verification credits.',
    idempotent: true,
  },
  outputSchema: getBulkEmailVerificationResultActionOutputSchema,
  props: {
    task_id: Property.ShortText({
      displayName: 'Task ID',
      description:
        'Provide the task ID for the bulk verification task. You can fetch this from the `Create Bulk Email Verification` action.',
      required: true,
    }),
  },
  async run(context) {
    const { task_id } = context.propsValue;

    const response = await verifyEmailsResult(task_id, context.auth.secret_text);

    return response.body;
  },
});