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.2 KB
Raw Blame
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod } from '@activepieces/pieces-common';
import { woodpeckerAuth } from '../..';
import { woodpeckerClient } from '../common';

export const blacklistDomain = createAction({
  auth: woodpeckerAuth,
  name: 'blacklist_domain',
  displayName: 'Blacklist Domain',
  description: 'Add a domain to the blacklist to block sending to all prospects within that domain',
  audience: 'both',
  aiMetadata: { description: 'Add a domain (e.g. example.com) to the account-wide blacklist so Woodpecker stops emailing every prospect at that domain. Use to suppress an entire company or to honor an unsubscribe-by-domain request. Blacklisting an already-blacklisted domain leaves it blacklisted with no additional effect.', idempotent: true },
  props: {
    domain: Property.ShortText({
      displayName: 'Domain',
      description: 'Domain to blacklist (e.g. example.com)',
      required: true,
    }),
  },
  async run({ auth, propsValue }) {
    return await woodpeckerClient.makeRequest(
      auth.secret_text,
      HttpMethod.POST,
      '/v2/blacklist/domains',
      {
        domains: [propsValue.domain],
      }
    );
  },
});