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

feat(maileroo): add AI actions and output schemas (#16005)

Kishan Parmar3d4c6f98b27c
diff --git a/packages/pieces/community/maileroo/package.json b/packages/pieces/community/maileroo/package.json
index c6ccfb365c4..132113ac9c8 100644
--- a/packages/pieces/community/maileroo/package.json
+++ b/packages/pieces/community/maileroo/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-maileroo",
- "version": "0.2.5",
+ "version": "0.3.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
diff --git a/packages/pieces/community/maileroo/src/index.ts b/packages/pieces/community/maileroo/src/index.ts
index 3f86a4f8c41..34a997c2b6f 100644
--- a/packages/pieces/community/maileroo/src/index.ts
+++ b/packages/pieces/community/maileroo/src/index.ts
@@ -1,14 +1,45 @@
+import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { createPiece } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/pieces-framework';
import { sendEmail } from './lib/actions/send-email';
import { sendFromTemplate } from './lib/actions/send-from-template';
import { verifyEmail } from './lib/actions/verify-email';
import { mailerooAuth } from './lib/auth';
+import { mailerooCreateDomain } from './lib/actions/ai/create-domain';
+import { mailerooCreateInboundRoute } from './lib/actions/ai/create-inbound-route';
+import { mailerooCreateSuppression } from './lib/actions/ai/create-suppression';
+import { mailerooCreateTemplate } from './lib/actions/ai/create-template';
+import { mailerooDeleteDomain } from './lib/actions/ai/delete-domain';
+import { mailerooDeleteInboundRoute } from './lib/actions/ai/delete-inbound-route';
+import { mailerooDeleteScheduledEmail } from './lib/actions/ai/delete-scheduled-email';
+import { mailerooDeleteSuppression } from './lib/actions/ai/delete-suppression';
+import { mailerooDeleteTemplate } from './lib/actions/ai/delete-template';
+import { mailerooGetDomainAnalytics } from './lib/actions/ai/get-domain-analytics';
+import { mailerooGetDomain } from './lib/actions/ai/get-domain';
+import { mailerooGetEmailLog } from './lib/actions/ai/get-email-log';
+import { mailerooGetInboundRoute } from './lib/actions/ai/get-inbound-route';
+import { mailerooGetStatisticsSummary } from './lib/actions/ai/get-statistics-summary';
+import { mailerooGetStatisticsTimeline } from './lib/actions/ai/get-statistics-timeline';
+import { mailerooGetTemplate } from './lib/actions/ai/get-template';
+import { mailerooListDomains } from './lib/actions/ai/list-domains';
+import { mailerooListInboundRoutes } from './lib/actions/ai/list-inbound-routes';
+import { mailerooListScheduledEmails } from './lib/actions/ai/list-scheduled-emails';
+import { mailerooListSuppressions } from './lib/actions/ai/list-suppressions';
+import { mailerooListTemplates } from './lib/actions/ai/list-templates';
+import { mailerooRenameTemplate } from './lib/actions/ai/rename-template';
+import { mailerooRenderEmailLog } from './lib/actions/ai/render-email-log';
+import { mailerooResendEmail } from './lib/actions/ai/resend-email';
+import { mailerooSearchDomainEmailLogs } from './lib/actions/ai/search-domain-email-logs';
+import { mailerooSearchEmailLogs } from './lib/actions/ai/search-email-logs';
+import { mailerooSendBulkEmails } from './lib/actions/ai/send-bulk-emails';
+import { mailerooSendEmail } from './lib/actions/ai/send-email';
+import { mailerooUpdateDomainSettings } from './lib/actions/ai/update-domain-settings';
+import { mailerooUpdateInboundRoute } from './lib/actions/ai/update-inbound-route';
export const maileroo = createPiece({
displayName: 'Maileroo',
auth: mailerooAuth,
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/maileroo.png',
categories: [
PieceCategory.MARKETING,
@@ -17,6 +48,54 @@ export const maileroo = createPiece({
],
description: 'Email Delivery Service with Real-Time Analytics and Reporting',
authors: ['codegino'],
- actions: [sendEmail, sendFromTemplate, verifyEmail],
+ actions: [
+ sendEmail,
+ sendFromTemplate,
+ verifyEmail,
+ mailerooCreateDomain,
+ mailerooCreateInboundRoute,
+ mailerooCreateSuppression,
+ mailerooCreateTemplate,
+ mailerooDeleteDomain,
+ mailerooDeleteInboundRoute,
+ mailerooDeleteScheduledEmail,
+ mailerooDeleteSuppression,
+ mailerooDeleteTemplate,
+ mailerooGetDomainAnalytics,
+ mailerooGetDomain,
+ mailerooGetEmailLog,
+ mailerooGetInboundRoute,
+ mailerooGetStatisticsSummary,
+ mailerooGetStatisticsTimeline,
+ mailerooGetTemplate,
+ mailerooListDomains,
+ mailerooListInboundRoutes,
+ mailerooListScheduledEmails,
+ mailerooListSuppressions,
+ mailerooListTemplates,
+ mailerooRenameTemplate,
+ mailerooRenderEmailLog,
+ mailerooResendEmail,
+ mailerooSearchDomainEmailLogs,
+ mailerooSearchEmailLogs,
+ mailerooSendBulkEmails,
+ mailerooSendEmail,
+ mailerooUpdateDomainSettings,
+ mailerooUpdateInboundRoute,
+ createCustomApiCallAction({
+ baseUrl: (auth) => baseUrlFor(auth?.props.keyType),
+ auth: mailerooAuth,
+ authMapping: async (auth) =>
+ auth.props.keyType === 'account'
+ ? { Authorization: `Bearer ${auth.props.apiKey}` }
+ : { 'X-API-Key': auth.props.apiKey },
+ }),
+ ],
triggers: [],
});
+
+function baseUrlFor(keyType: string | undefined): string {
+ if (keyType === 'account') return 'https://api.maileroo.com/v1';
+ if (keyType === 'verification') return 'https://verify.maileroo.net';
+ return 'https://smtp.maileroo.com/api/v2';
+}
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/create-domain.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/create-domain.ts
new file mode 100644
index 00000000000..5f4261afe51
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/create-domain.ts
@@ -0,0 +1,63 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property, spreadIfDefined } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooDomainOutputSchema } from '../../output-schemas';
+
+export const mailerooCreateDomain = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_create_domain',
+ outputSchema: mailerooDomainOutputSchema,
+ displayName: 'Create Domain',
+ description: 'Adds a custom domain or a free sub-domain.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Adds a domain to the account and returns the DNS records to configure. Use type custom with domain_name, or type free with sub_domain. Not idempotent: adding the same domain twice fails or duplicates. Requires an Account Key connection.',
+ idempotent: false,
+ },
+ props: {
+ type: Property.StaticDropdown({
+ displayName: 'Type',
+ description: 'Custom domain or free sub-domain.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Custom domain', value: 'custom' },
+ { label: 'Free sub-domain', value: 'free' },
+ ],
+ },
+ }),
+ domain_name: Property.ShortText({
+ displayName: 'Domain Name',
+ description: 'Required for type custom, for example example.com.',
+ required: false,
+ }),
+ sub_domain: Property.ShortText({
+ displayName: 'Sub-domain',
+ description: 'Required for type free.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { type, domain_name, sub_domain } = context.propsValue;
+ if (type === 'custom' && !domain_name) {
+ throw new Error('Domain Name is required when the type is custom.');
+ }
+ if (type === 'free' && !sub_domain) {
+ throw new Error('Sub-domain is required when the type is free.');
+ }
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/domains',
+ body: {
+ type,
+ ...spreadIfDefined('domain_name', type === 'custom' ? domain_name : undefined),
+ ...spreadIfDefined('sub_domain', type === 'free' ? sub_domain : undefined),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/create-inbound-route.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/create-inbound-route.ts
new file mode 100644
index 00000000000..247e9185139
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/create-inbound-route.ts
@@ -0,0 +1,172 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property, spreadIfDefined } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooInboundRouteOutputSchema } from '../../output-schemas';
+
+export const mailerooCreateInboundRoute = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_create_inbound_route',
+ outputSchema: mailerooInboundRouteOutputSchema,
+ displayName: 'Create Inbound Route',
+ description: 'Creates an inbound route for a domain.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Creates a rule that forwards mail received on a domain to email addresses or callback URLs. Match recipient needs Recipient, Match header needs Header Name and Header Content, Custom expression needs Custom Expression. Not idempotent: each call creates another route. Requires an Account Key connection.',
+ idempotent: false,
+ },
+ props: {
+ domain_id: Property.Number({
+ displayName: 'Domain ID',
+ description: 'Numeric domain ID. Get it from maileroo_list_domains.',
+ required: true,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: '3 to 255 characters.',
+ required: true,
+ }),
+ expression_type: Property.StaticDropdown({
+ displayName: 'Match Type',
+ description: 'How the route matches incoming mail.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Catch all', value: 'catch_all' },
+ { label: 'Match recipient', value: 'match_recipient' },
+ { label: 'Match header', value: 'match_header' },
+ { label: 'Custom expression', value: 'custom' },
+ ],
+ },
+ }),
+ forward_list: Property.Array({
+ displayName: 'Forward To',
+ description: 'Email addresses and/or callback URLs to forward matched mail to.',
+ required: true,
+ }),
+ priority: Property.Number({
+ displayName: 'Priority',
+ description: '1 (highest) to 100 (lowest).',
+ required: true,
+ }),
+ recipient: Property.ShortText({
+ displayName: 'Recipient',
+ description: 'Required for Match recipient.',
+ required: false,
+ }),
+ header_name: Property.ShortText({
+ displayName: 'Header Name',
+ description: 'Required for Match header.',
+ required: false,
+ }),
+ header_content: Property.ShortText({
+ displayName: 'Header Content',
+ description: 'Required for Match header.',
+ required: false,
+ }),
+ custom_expression: Property.ShortText({
+ displayName: 'Custom Expression',
+ description: 'Required for Custom expression.',
+ required: false,
+ }),
+ regex_enabled: Property.StaticDropdown({
+ displayName: 'Regex',
+ description: 'Treat the expression content as a regular expression.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ dmarc_alignment: Property.StaticDropdown({
+ displayName: 'Require DMARC Alignment',
+ description: '',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ require_spf: Property.StaticDropdown({
+ displayName: 'Require SPF Pass',
+ description: '',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ require_dkim: Property.StaticDropdown({
+ displayName: 'Require DKIM Pass',
+ description: '',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ skip_spam_check: Property.StaticDropdown({
+ displayName: 'Skip Spam Check',
+ description: '',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ stop: Property.StaticDropdown({
+ displayName: 'Stop Processing',
+ description: 'Stop evaluating further routes when matched.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { domain_id, description, expression_type, forward_list, priority, recipient, header_name, header_content, custom_expression, regex_enabled, dmarc_alignment, require_spf, require_dkim, skip_spam_check, stop } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/domains/${encodeURIComponent(domain_id)}/inbound-routes`,
+ body: {
+ description,
+ expression_type,
+ forward_list: mailerooClient.toStrings(forward_list),
+ priority,
+ ...spreadIfDefined('recipient', recipient),
+ ...spreadIfDefined('header_name', header_name),
+ ...spreadIfDefined('header_content', header_content),
+ ...spreadIfDefined('custom_expression', custom_expression),
+ ...spreadIfDefined('regex_enabled', mailerooClient.optionalBoolean(regex_enabled)),
+ ...spreadIfDefined('dmarc_alignment', mailerooClient.optionalBoolean(dmarc_alignment)),
+ ...spreadIfDefined('require_spf', mailerooClient.optionalBoolean(require_spf)),
+ ...spreadIfDefined('require_dkim', mailerooClient.optionalBoolean(require_dkim)),
+ ...spreadIfDefined('skip_spam_check', mailerooClient.optionalBoolean(skip_spam_check)),
+ ...spreadIfDefined('stop', mailerooClient.optionalBoolean(stop)),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/create-suppression.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/create-suppression.ts
new file mode 100644
index 00000000000..619a7fef8b3
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/create-suppression.ts
@@ -0,0 +1,44 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property, spreadIfDefined } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooCreateSuppressionOutputSchema } from '../../output-schemas';
+
+export const mailerooCreateSuppression = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_create_suppression',
+ outputSchema: mailerooCreateSuppressionOutputSchema,
+ displayName: 'Add Suppression',
+ description: 'Adds an email address to the suppression list.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Blocks an address so no email is delivered to it until it is removed with maileroo_delete_suppression. Adding an address already suppressed leaves it suppressed. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ email_address: Property.ShortText({
+ displayName: 'Email Address',
+ description: 'Address to suppress.',
+ required: true,
+ }),
+ reason: Property.ShortText({
+ displayName: 'Reason',
+ description: 'Optional note on why it was suppressed.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { email_address, reason } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/suppressions',
+ body: {
+ email_address,
+ ...spreadIfDefined('reason', reason),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/create-template.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/create-template.ts
new file mode 100644
index 00000000000..26d6481faf3
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/create-template.ts
@@ -0,0 +1,68 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooCreateTemplateOutputSchema } from '../../output-schemas';
+
+export const mailerooCreateTemplate = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_create_template',
+ outputSchema: mailerooCreateTemplateOutputSchema,
+ displayName: 'Create Template',
+ description: 'Creates an email template from HTML, a URL or a zip.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Creates a template: type html needs a complete HTML document (starting with <!DOCTYPE html> and including <html> and <body>; a fragment is rejected), type url needs URL, type zip needs a base64 zip. Returns the new template; use its ID with the send actions. Not idempotent: each call creates another template. Requires an Account Key connection.',
+ idempotent: false,
+ },
+ props: {
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Template name, 1 to 128 characters.',
+ required: true,
+ }),
+ type: Property.StaticDropdown({
+ displayName: 'Type',
+ description: 'Where the content comes from.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'HTML', value: 'html' },
+ { label: 'URL', value: 'url' },
+ { label: 'Zip (base64)', value: 'zip' },
+ ],
+ },
+ }),
+ html: Property.LongText({
+ displayName: 'HTML',
+ description: 'Required for type html.',
+ required: false,
+ }),
+ url: Property.ShortText({
+ displayName: 'URL',
+ description: 'Required for type url.',
+ required: false,
+ }),
+ zip_base64: Property.LongText({
+ displayName: 'Zip (base64)',
+ description: 'Required for type zip.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { name, type, html, url, zip_base64 } = context.propsValue;
+ const content = { html, url, zip: zip_base64 }[type];
+ if (!content) {
+ throw new Error(`The content field matching type ${type} is required.`);
+ }
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/templates',
+ body: { name, type, ...(type === 'zip' ? { zip_base64 } : { [type]: content }) },
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/delete-domain.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/delete-domain.ts
new file mode 100644
index 00000000000..76d67085929
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/delete-domain.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooSuccessOutputSchema } from '../../output-schemas';
+
+export const mailerooDeleteDomain = createAction({
+ auth: mailerooAuth,
+ outputSchema: mailerooSuccessOutputSchema,
+ name: 'maileroo_delete_domain',
+ displayName: 'Delete Domain',
+ description: 'Permanently deletes a domain.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently deletes a domain and cannot be undone; sending from it stops. Get the domain_id from maileroo_list_domains. Hard delete: there is no recoverable variant. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ domain_id: Property.Number({
+ displayName: 'Domain ID',
+ description: 'Numeric domain ID. Get it from maileroo_list_domains.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { domain_id } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/domains/${encodeURIComponent(domain_id)}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/delete-inbound-route.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/delete-inbound-route.ts
new file mode 100644
index 00000000000..161337e6522
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/delete-inbound-route.ts
@@ -0,0 +1,40 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooSuccessOutputSchema } from '../../output-schemas';
+
+export const mailerooDeleteInboundRoute = createAction({
+ auth: mailerooAuth,
+ outputSchema: mailerooSuccessOutputSchema,
+ name: 'maileroo_delete_inbound_route',
+ displayName: 'Delete Inbound Route',
+ description: 'Deletes an inbound route.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently deletes an inbound route of a domain; mail it matched is no longer forwarded. Get the route ID from maileroo_list_inbound_routes. Hard delete. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ domain_id: Property.Number({
+ displayName: 'Domain ID',
+ description: 'Numeric domain ID. Get it from maileroo_list_domains.',
+ required: true,
+ }),
+ route_id: Property.ShortText({
+ displayName: 'Route ID',
+ description: 'Route ID from maileroo_list_inbound_routes.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { domain_id, route_id } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/domains/${encodeURIComponent(domain_id)}/inbound-routes/${encodeURIComponent(route_id)}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/delete-scheduled-email.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/delete-scheduled-email.ts
new file mode 100644
index 00000000000..bfacb939020
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/delete-scheduled-email.ts
@@ -0,0 +1,31 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooDeleteScheduledEmailOutputSchema } from '../../output-schemas';
+
+export const mailerooDeleteScheduledEmail = createAction({
+ auth: mailerooAuth,
+ outputSchema: mailerooDeleteScheduledEmailOutputSchema,
+ name: 'maileroo_delete_scheduled_email',
+ displayName: 'Delete Scheduled Email',
+ description: 'Cancels a scheduled email.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Cancels an email that has not been delivered yet, permanently. Get the reference ID from maileroo_send_email (when scheduled) or maileroo_list_scheduled_emails. Requires a Sending Key connection. Hard delete: the email cannot be restored.',
+ idempotent: true,
+ },
+ props: {
+ reference_id: Property.ShortText({ displayName: 'Reference ID', description: 'Reference ID of the scheduled email.', required: true }),
+ },
+ async run(context) {
+ const response = await mailerooClient.emailRequest<null>({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/emails/scheduled/${encodeURIComponent(context.propsValue.reference_id)}`,
+ });
+ return { success: response.success, message: response.message };
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/delete-suppression.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/delete-suppression.ts
new file mode 100644
index 00000000000..a064c631f42
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/delete-suppression.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooSuccessOutputSchema } from '../../output-schemas';
+
+export const mailerooDeleteSuppression = createAction({
+ auth: mailerooAuth,
+ outputSchema: mailerooSuccessOutputSchema,
+ name: 'maileroo_delete_suppression',
+ displayName: 'Delete Suppression',
+ description: 'Removes an address from the suppression list.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Removes a suppression so the address can receive email again. Pass either the numeric suppression ID from maileroo_list_suppressions or the email address itself. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ identifier: Property.ShortText({
+ displayName: 'Suppression ID or Email',
+ description: 'Numeric suppression ID or the suppressed email address.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { identifier } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/suppressions/${encodeURIComponent(identifier)}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/delete-template.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/delete-template.ts
new file mode 100644
index 00000000000..824c3c409d2
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/delete-template.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooSuccessOutputSchema } from '../../output-schemas';
+
+export const mailerooDeleteTemplate = createAction({
+ auth: mailerooAuth,
+ outputSchema: mailerooSuccessOutputSchema,
+ name: 'maileroo_delete_template',
+ displayName: 'Delete Template',
+ description: 'Deletes an email template.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description: 'Permanently deletes a template; sends that reference it will fail. Get the template ID from maileroo_list_templates. Hard delete. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ template_id: Property.Number({
+ displayName: 'Template ID',
+ description: 'Template ID from maileroo_list_templates.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { template_id } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/templates/${encodeURIComponent(template_id)}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/get-domain-analytics.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/get-domain-analytics.ts
new file mode 100644
index 00000000000..0618bc4ff3e
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/get-domain-analytics.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooGetDomainAnalyticsOutputSchema } from '../../output-schemas';
+
+export const mailerooGetDomainAnalytics = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_get_domain_analytics',
+ outputSchema: mailerooGetDomainAnalyticsOutputSchema,
+ displayName: 'Get Domain Analytics',
+ description: 'Gets totals, a daily timeline and top providers for a domain.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns aggregate delivered, bounced, opens, clicks and suppressions for one domain, a daily timeline and the top receiving providers. Get the domain_id from maileroo_list_domains. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ domain_id: Property.Number({
+ displayName: 'Domain ID',
+ description: 'Numeric domain ID. Get it from maileroo_list_domains.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { domain_id } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/domains/${encodeURIComponent(domain_id)}/analytics`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/get-domain.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/get-domain.ts
new file mode 100644
index 00000000000..d44a22c5d9d
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/get-domain.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooDomainOutputSchema } from '../../output-schemas';
+
+export const mailerooGetDomain = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_get_domain',
+ outputSchema: mailerooDomainOutputSchema,
+ displayName: 'Get Domain',
+ description: 'Gets a domain with its DNS records, settings and statistics.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns one domain with the DKIM, SPF, DMARC, MX and tracking DNS records to configure, verification status, tracking settings and sending statistics. Get the domain_id from maileroo_list_domains. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ domain_id: Property.Number({
+ displayName: 'Domain ID',
+ description: 'Numeric domain ID. Get it from maileroo_list_domains.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { domain_id } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/domains/${encodeURIComponent(domain_id)}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/get-email-log.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/get-email-log.ts
new file mode 100644
index 00000000000..e2a8500a0bf
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/get-email-log.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooGetEmailLogOutputSchema } from '../../output-schemas';
+
+export const mailerooGetEmailLog = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_get_email_log',
+ outputSchema: mailerooGetEmailLogOutputSchema,
+ displayName: 'Get Email Log',
+ description: 'Gets the stored raw message for a message ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns the sender, recipients, collection time and the raw RFC822 source of a stored email. Get the message ID from maileroo_search_email_logs; use maileroo_render_email_log for a browser-viewable URL instead. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ message_id: Property.ShortText({
+ displayName: 'Message ID',
+ description: 'Message ID from maileroo_search_email_logs.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { message_id } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/logs/email/${encodeURIComponent(message_id)}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/get-inbound-route.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/get-inbound-route.ts
new file mode 100644
index 00000000000..daf60cd6b87
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/get-inbound-route.ts
@@ -0,0 +1,40 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooInboundRouteOutputSchema } from '../../output-schemas';
+
+export const mailerooGetInboundRoute = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_get_inbound_route',
+ outputSchema: mailerooInboundRouteOutputSchema,
+ displayName: 'Get Inbound Route',
+ description: 'Gets one inbound route.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns a single inbound route of a domain. Get the route ID from maileroo_list_inbound_routes. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ domain_id: Property.Number({
+ displayName: 'Domain ID',
+ description: 'Numeric domain ID. Get it from maileroo_list_domains.',
+ required: true,
+ }),
+ route_id: Property.ShortText({
+ displayName: 'Route ID',
+ description: 'Route ID from maileroo_list_inbound_routes.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { domain_id, route_id } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/domains/${encodeURIComponent(domain_id)}/inbound-routes/${encodeURIComponent(route_id)}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/get-statistics-summary.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/get-statistics-summary.ts
new file mode 100644
index 00000000000..f8d2d434dca
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/get-statistics-summary.ts
@@ -0,0 +1,28 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooGetStatisticsSummaryOutputSchema } from '../../output-schemas';
+
+export const mailerooGetStatisticsSummary = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_get_statistics_summary',
+ outputSchema: mailerooGetStatisticsSummaryOutputSchema,
+ displayName: 'Get Statistics Summary',
+ description: 'Gets aggregate sending statistics for the current calendar month.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns this calendar month\'s delivered, bounced, opens, clicks and suppression totals plus per-country open and click counts for the whole account. Use maileroo_get_statistics_timeline for a day-by-day view or maileroo_get_domain_analytics for one domain. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {},
+ async run(context) {
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: '/statistics/summary',
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/get-statistics-timeline.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/get-statistics-timeline.ts
new file mode 100644
index 00000000000..a9397e35142
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/get-statistics-timeline.ts
@@ -0,0 +1,28 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooGetStatisticsTimelineOutputSchema } from '../../output-schemas';
+
+export const mailerooGetStatisticsTimeline = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_get_statistics_timeline',
+ outputSchema: mailerooGetStatisticsTimelineOutputSchema,
+ displayName: 'Get Statistics Timeline',
+ description: 'Gets daily sending statistics for the last month.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns one entry per day for the last month with delivered, bounced, opens, clicks and suppressions plus per-country open and click data. Use maileroo_get_statistics_summary for monthly totals only. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {},
+ async run(context) {
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: '/statistics/timeline',
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/get-template.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/get-template.ts
new file mode 100644
index 00000000000..5ec3f6e1732
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/get-template.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooGetTemplateOutputSchema } from '../../output-schemas';
+
+export const mailerooGetTemplate = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_get_template',
+ outputSchema: mailerooGetTemplateOutputSchema,
+ displayName: 'Get Template',
+ description: 'Gets a template with its HTML and plain text.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns one template including its HTML and plain-text content. Get the template ID from maileroo_list_templates. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ template_id: Property.Number({
+ displayName: 'Template ID',
+ description: 'Template ID from maileroo_list_templates.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { template_id } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/templates/${encodeURIComponent(template_id)}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/list-domains.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/list-domains.ts
new file mode 100644
index 00000000000..62f6e0cfb77
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/list-domains.ts
@@ -0,0 +1,74 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooListDomainsOutputSchema } from '../../output-schemas';
+
+export const mailerooListDomains = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_list_domains',
+ outputSchema: mailerooListDomainsOutputSchema,
+ displayName: 'List Domains',
+ description: 'Lists the account\'s domains with basic statistics.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists domains with their ID, name, DNS verification status and delivered, bounced, opened and clicked counts; this is the source of the domain_id used by every domain action. Supports search by name, sorting and paging. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ search: Property.ShortText({
+ displayName: 'Search',
+ description: 'Filter domains by name.',
+ required: false,
+ }),
+ page: Property.Number({
+ displayName: 'Page',
+ description: 'Page number, starting at 1.',
+ required: false,
+ }),
+ per_page: Property.Number({
+ displayName: 'Per Page',
+ description: 'Items per page (10 to 100).',
+ required: false,
+ }),
+ sort_by: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'ID', value: 'id' },
+ { label: 'Domain name', value: 'domain_name' },
+ { label: 'Delivered', value: 'delivered' },
+ { label: 'Bounced', value: 'bounced' },
+ { label: 'Opened', value: 'opened' },
+ { label: 'Clicked', value: 'clicked' },
+ ],
+ },
+ }),
+ sort_dir: Property.StaticDropdown({
+ displayName: 'Sort Direction',
+ description: 'Sort direction.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Ascending', value: 'asc' },
+ { label: 'Descending', value: 'desc' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { search, page, per_page, sort_by, sort_dir } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: '/domains',
+ queryParams: mailerooClient.toQuery({ search, page, per_page, sort_by, sort_dir }),
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/list-inbound-routes.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/list-inbound-routes.ts
new file mode 100644
index 00000000000..3e7d4d273a5
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/list-inbound-routes.ts
@@ -0,0 +1,46 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooListInboundRoutesOutputSchema } from '../../output-schemas';
+
+export const mailerooListInboundRoutes = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_list_inbound_routes',
+ outputSchema: mailerooListInboundRoutesOutputSchema,
+ displayName: 'List Inbound Routes',
+ description: 'Lists a domain\'s inbound routes.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the inbound routing rules of a domain sorted by priority, 10 per page, with their match type, forward targets and flags. Supports a text search over description, recipient, header and expression. Get the domain_id from maileroo_list_domains. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ domain_id: Property.Number({
+ displayName: 'Domain ID',
+ description: 'Numeric domain ID. Get it from maileroo_list_domains.',
+ required: true,
+ }),
+ search: Property.ShortText({
+ displayName: 'Search',
+ description: 'Matches description, recipient, header or expression.',
+ required: false,
+ }),
+ page: Property.Number({
+ displayName: 'Page',
+ description: 'Page number, starting at 1.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { domain_id, search, page } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/domains/${encodeURIComponent(domain_id)}/inbound-routes`,
+ queryParams: mailerooClient.toQuery({ search, page }),
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/list-scheduled-emails.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/list-scheduled-emails.ts
new file mode 100644
index 00000000000..d63f682d949
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/list-scheduled-emails.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooListScheduledEmailsOutputSchema } from '../../output-schemas';
+
+export const mailerooListScheduledEmails = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_list_scheduled_emails',
+ outputSchema: mailerooListScheduledEmailsOutputSchema,
+ displayName: 'List Scheduled Emails',
+ description: 'Lists emails scheduled for future delivery.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists emails still waiting to be delivered with their reference ID, sender, recipients, subject, tags and scheduled time. Use the reference ID with maileroo_delete_scheduled_email to cancel one. Domain is optional for domain-scoped sending keys but required for application-scoped keys. Requires a Sending Key connection.',
+ idempotent: true,
+ },
+ props: {
+ domain: Property.ShortText({ displayName: 'Domain', description: 'Domain the emails were scheduled from, for example example.com.', required: false }),
+ page: Property.Number({ displayName: 'Page', description: 'Page number, starting at 1.', required: false }),
+ per_page: Property.Number({ displayName: 'Per Page', description: 'Results per page, at most 100.', required: false }),
+ },
+ async run(context) {
+ const { domain, page, per_page } = context.propsValue;
+ const response = await mailerooClient.emailRequest<Record<string, unknown>>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: '/emails/scheduled',
+ queryParams: mailerooClient.toQuery({ domain, page, per_page }),
+ });
+ return response.data;
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/list-suppressions.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/list-suppressions.ts
new file mode 100644
index 00000000000..dac52fc8a81
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/list-suppressions.ts
@@ -0,0 +1,46 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooListSuppressionsOutputSchema } from '../../output-schemas';
+
+export const mailerooListSuppressions = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_list_suppressions',
+ outputSchema: mailerooListSuppressionsOutputSchema,
+ displayName: 'List Suppressions',
+ description: 'Lists suppressed email addresses.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists addresses that Maileroo will not send to, with ID and reason, searchable by address and paged. Use before a send to check whether a recipient is blocked. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ search: Property.ShortText({
+ displayName: 'Search',
+ description: 'Filter by email address.',
+ required: false,
+ }),
+ page: Property.Number({
+ displayName: 'Page',
+ description: 'Page number, starting at 1.',
+ required: false,
+ }),
+ per_page: Property.Number({
+ displayName: 'Per Page',
+ description: 'Items per page (10 to 100).',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { search, page, per_page } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: '/suppressions',
+ queryParams: mailerooClient.toQuery({ search, page, per_page }),
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/list-templates.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/list-templates.ts
new file mode 100644
index 00000000000..72b68467908
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/list-templates.ts
@@ -0,0 +1,36 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooListTemplatesOutputSchema } from '../../output-schemas';
+
+export const mailerooListTemplates = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_list_templates',
+ outputSchema: mailerooListTemplatesOutputSchema,
+ displayName: 'List Templates',
+ description: 'Lists email templates.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Lists the account\'s email templates with ID, name, type and preview URL, optionally filtered by name. The template ID is used by maileroo_send_bulk_emails and the template send action. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ search: Property.ShortText({
+ displayName: 'Search',
+ description: 'Filter by template name.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { search } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: '/templates',
+ queryParams: mailerooClient.toQuery({ search }),
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/rename-template.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/rename-template.ts
new file mode 100644
index 00000000000..855bf1480ff
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/rename-template.ts
@@ -0,0 +1,43 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooSuccessOutputSchema } from '../../output-schemas';
+
+export const mailerooRenameTemplate = createAction({
+ auth: mailerooAuth,
+ outputSchema: mailerooSuccessOutputSchema,
+ name: 'maileroo_rename_template',
+ displayName: 'Rename Template',
+ description: 'Renames an email template.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Changes only the template name; the content is untouched. Get the template ID from maileroo_list_templates. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ template_id: Property.Number({
+ displayName: 'Template ID',
+ description: 'Template ID from maileroo_list_templates.',
+ required: true,
+ }),
+ template_name: Property.ShortText({
+ displayName: 'New Name',
+ description: '1 to 128 characters.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { template_id, template_name } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.PATCH,
+ path: `/templates/${encodeURIComponent(template_id)}`,
+ body: {
+ template_name,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/render-email-log.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/render-email-log.ts
new file mode 100644
index 00000000000..3febbec303c
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/render-email-log.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooRenderEmailLogOutputSchema } from '../../output-schemas';
+
+export const mailerooRenderEmailLog = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_render_email_log',
+ outputSchema: mailerooRenderEmailLogOutputSchema,
+ displayName: 'Render Email Log',
+ description: 'Gets a viewable URL for a stored email.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description: 'Returns a URL that shows the rendered stored email in a browser. Get the message ID from maileroo_search_email_logs. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ message_id: Property.ShortText({
+ displayName: 'Message ID',
+ description: 'Message ID from maileroo_search_email_logs.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { message_id } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/logs/email/${encodeURIComponent(message_id)}/render`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/resend-email.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/resend-email.ts
new file mode 100644
index 00000000000..f474d84c56f
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/resend-email.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooResendEmailOutputSchema } from '../../output-schemas';
+
+export const mailerooResendEmail = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_resend_email',
+ outputSchema: mailerooResendEmailOutputSchema,
+ displayName: 'Resend Email',
+ description: 'Requeues a previously sent email for another delivery attempt.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Re-sends a stored message as-is under a new reference ID, which is returned. Delivers real mail to the original recipients again, so confirm intent first. Get the message ID from maileroo_search_email_logs. Not idempotent: each call queues another delivery. Requires an Account Key connection.',
+ idempotent: false,
+ },
+ props: {
+ message_id: Property.ShortText({
+ displayName: 'Message ID',
+ description: 'Message ID from maileroo_search_email_logs.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { message_id } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/logs/email/${encodeURIComponent(message_id)}/resend`,
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/search-domain-email-logs.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/search-domain-email-logs.ts
new file mode 100644
index 00000000000..1ee388b2866
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/search-domain-email-logs.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property, spreadIfDefined } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooProps } from '../../common/props';
+import { mailerooSearchDomainEmailLogsOutputSchema } from '../../output-schemas';
+
+export const mailerooSearchDomainEmailLogs = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_search_domain_email_logs',
+ outputSchema: mailerooSearchDomainEmailLogsOutputSchema,
+ displayName: 'Search Domain Email Logs',
+ description: 'Searches email event logs of one domain.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Same as maileroo_search_email_logs but limited to a single domain; use it when the domain is known. Each hit carries a message ID usable with maileroo_get_email_log and maileroo_render_email_log. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ domain_id: Property.Number({ displayName: 'Domain ID', description: 'Numeric domain ID. Get it from maileroo_list_domains.', required: true }),
+ ...mailerooProps.logFilters,
+ },
+ async run(context) {
+ const { domain_id, page, ...filterValues } = context.propsValue;
+ const filters = mailerooProps.buildLogFilters(filterValues);
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/domains/${encodeURIComponent(domain_id)}/logs/search`,
+ body: { filters, ...spreadIfDefined('page', page) },
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/search-email-logs.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/search-email-logs.ts
new file mode 100644
index 00000000000..13e5a8d1ca1
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/search-email-logs.ts
@@ -0,0 +1,34 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property, spreadIfDefined } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooProps } from '../../common/props';
+import { mailerooSearchDomainEmailLogsOutputSchema } from '../../output-schemas';
+
+export const mailerooSearchEmailLogs = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_search_email_logs',
+ outputSchema: mailerooSearchDomainEmailLogsOutputSchema,
+ displayName: 'Search Email Logs',
+ description: 'Searches email event logs across all domains.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description: 'Searches delivery events (delivered, deferred, suppressed, bounced, complained) across every domain by message ID, reference ID, subject, sender, recipient, type or time range. Each hit carries a message ID usable with maileroo_get_email_log, maileroo_render_email_log and maileroo_resend_email. Use maileroo_search_domain_email_logs to limit to one domain. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ ...mailerooProps.logFilters,
+ },
+ async run(context) {
+ const { page, ...filterValues } = context.propsValue;
+ const filters = mailerooProps.buildLogFilters(filterValues);
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/logs/search',
+ body: { filters, ...spreadIfDefined('page', page) },
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/send-bulk-emails.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/send-bulk-emails.ts
new file mode 100644
index 00000000000..dced8b273ca
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/send-bulk-emails.ts
@@ -0,0 +1,56 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property, spreadIfDefined } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooProps } from '../../common/props';
+import { mailerooSendBulkEmailsOutputSchema } from '../../output-schemas';
+
+export const mailerooSendBulkEmails = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_send_bulk_emails',
+ outputSchema: mailerooSendBulkEmailsOutputSchema,
+ displayName: 'Send Bulk Emails',
+ description: 'Sends up to 500 personalized emails in one request.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Sends many emails in one call, each with its own recipients and template_data, sharing one subject and body (HTML, plain text or a template ID). Messages is a JSON array of up to 500 objects like {"from":{"address":"[email protected]","display_name":"A"},"to":[{"address":"[email protected]"}],"template_data":{"first_name":"B"}}; Subject and body support {{ variable }} placeholders. Returns one reference ID per message. Use maileroo_send_email for a single email. Requires a Sending Key connection. Not idempotent: each call sends every message again.',
+ idempotent: false,
+ },
+ props: {
+ subject: Property.ShortText({ displayName: 'Subject', description: 'Shared subject, at most 255 characters. Supports {{ variable }} placeholders.', required: true }),
+ messages: Property.Json({ displayName: 'Messages', description: 'JSON array of up to 500 message objects with from, to, optional cc, bcc, reply_to, reference_id and template_data.', required: true }),
+ template_id: Property.Number({ displayName: 'Template ID', description: 'Saved template ID from maileroo_list_templates. Use this or HTML/Plain Text.', required: false }),
+ html: Property.LongText({ displayName: 'HTML Body', description: 'Shared HTML body with {{ variable }} placeholders.', required: false }),
+ plain: Property.LongText({ displayName: 'Plain Text Body', description: 'Shared plain text body with {{ variable }} placeholders.', required: false }),
+ tracking: mailerooProps.tracking,
+ tags: Property.Json({ displayName: 'Tags', description: 'Key-value tags as a JSON object.', required: false }),
+ headers: Property.Json({ displayName: 'Custom Headers', description: 'Custom headers as a JSON object.', required: false }),
+ },
+ async run(context) {
+ const { subject, messages, template_id, html, plain, tracking, tags, headers } = context.propsValue;
+ if (!Array.isArray(messages) || messages.length === 0 || messages.length > 500) {
+ throw new Error('Messages must be a JSON array with 1 to 500 items.');
+ }
+ if (template_id === undefined && !html && !plain) {
+ throw new Error('Provide a Template ID, an HTML Body, or a Plain Text Body.');
+ }
+ const response = await mailerooClient.emailRequest<{ reference_ids: string[] }>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/emails/bulk',
+ body: {
+ subject,
+ messages,
+ ...spreadIfDefined('template_id', template_id),
+ ...spreadIfDefined('html', html),
+ ...spreadIfDefined('plain', plain),
+ ...spreadIfDefined('tracking', mailerooClient.optionalBoolean(tracking)),
+ ...spreadIfDefined('tags', tags),
+ ...spreadIfDefined('headers', headers),
+ },
+ });
+ return { message: response.message, reference_ids: response.data.reference_ids };
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/send-email.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/send-email.ts
new file mode 100644
index 00000000000..9187668cbc6
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/send-email.ts
@@ -0,0 +1,64 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property, spreadIfDefined } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooProps } from '../../common/props';
+import { mailerooSendEmailOutputSchema } from '../../output-schemas';
+
+export const mailerooSendEmail = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_send_email',
+ outputSchema: mailerooSendEmailOutputSchema,
+ displayName: 'Send Email',
+ description: 'Sends or schedules a single email with HTML and/or plain text content.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Sends one email, or schedules it with Scheduled At, and returns its reference ID. Supports HTML and plain text, CC, BCC, reply-to, tags, custom headers and tracking. Use maileroo_send_bulk_emails for many personalized recipients. The From address must be on a verified domain; needs a Sending Key connection. Cancel a scheduled send with maileroo_delete_scheduled_email. Not idempotent: each call sends a new email.',
+ idempotent: false,
+ },
+ props: {
+ from: Property.ShortText({ displayName: 'From Email', description: 'Sender address on a verified domain.', required: true }),
+ from_name: Property.ShortText({ displayName: 'From Name', description: 'Sender display name.', required: false }),
+ to: Property.Array({ displayName: 'To', description: 'Recipient email addresses.', required: true }),
+ subject: Property.ShortText({ displayName: 'Subject', description: 'Subject, at most 255 characters.', required: true }),
+ html: Property.LongText({ displayName: 'HTML Body', description: 'HTML content. Provide HTML, plain text, or both.', required: false }),
+ plain: Property.LongText({ displayName: 'Plain Text Body', description: 'Plain text content. Generated from the HTML when omitted.', required: false }),
+ cc: Property.Array({ displayName: 'CC', description: 'Carbon copy addresses.', required: false }),
+ bcc: Property.Array({ displayName: 'BCC', description: 'Blind carbon copy addresses.', required: false }),
+ reply_to: Property.ShortText({ displayName: 'Reply To', description: 'Address that receives replies.', required: false }),
+ tracking: mailerooProps.tracking,
+ tags: Property.Json({ displayName: 'Tags', description: 'Key-value tags for categorizing the email, as a JSON object.', required: false }),
+ headers: Property.Json({ displayName: 'Custom Headers', description: 'Custom email headers as a JSON object.', required: false }),
+ scheduled_at: Property.ShortText({ displayName: 'Scheduled At', description: 'RFC 3339 timestamp such as 2026-12-01T09:00:00Z, or natural language such as "in 2 hours".', required: false }),
+ reference_id: Property.ShortText({ displayName: 'Reference ID', description: 'Optional 24-character hexadecimal ID for tracking. Generated when omitted.', required: false }),
+ },
+ async run(context) {
+ const { from, from_name, to, subject, html, plain, cc, bcc, reply_to, tracking, tags, headers, scheduled_at, reference_id } = context.propsValue;
+ if (!html && !plain) {
+ throw new Error('Provide an HTML Body, a Plain Text Body, or both.');
+ }
+ const response = await mailerooClient.emailRequest<{ reference_id: string }>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/emails',
+ body: {
+ from: { address: from, ...spreadIfDefined('display_name', from_name) },
+ to: mailerooClient.toStrings(to).map((address) => ({ address })),
+ subject,
+ ...spreadIfDefined('html', html),
+ ...spreadIfDefined('plain', plain),
+ ...spreadIfDefined('cc', cc && cc.length > 0 ? mailerooClient.toStrings(cc).map((address) => ({ address })) : undefined),
+ ...spreadIfDefined('bcc', bcc && bcc.length > 0 ? mailerooClient.toStrings(bcc).map((address) => ({ address })) : undefined),
+ ...spreadIfDefined('reply_to', reply_to ? [{ address: reply_to }] : undefined),
+ ...spreadIfDefined('tracking', mailerooClient.optionalBoolean(tracking)),
+ ...spreadIfDefined('tags', tags),
+ ...spreadIfDefined('headers', headers),
+ ...spreadIfDefined('scheduled_at', scheduled_at),
+ ...spreadIfDefined('reference_id', reference_id),
+ },
+ });
+ return { message: response.message, reference_id: response.data.reference_id };
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/update-domain-settings.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/update-domain-settings.ts
new file mode 100644
index 00000000000..a36809b2aea
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/update-domain-settings.ts
@@ -0,0 +1,69 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property, spreadIfDefined } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooUpdateDomainSettingsOutputSchema } from '../../output-schemas';
+
+export const mailerooUpdateDomainSettings = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_update_domain_settings',
+ outputSchema: mailerooUpdateDomainSettingsOutputSchema,
+ displayName: 'Update Domain Settings',
+ description: 'Updates a domain\'s tracking settings.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Changes open/click tracking, custom tracking hostname (paid plans only) and the return-path local part of a domain. Only supplied fields change; omitted ones keep their value. Get the domain_id from maileroo_list_domains. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ domain_id: Property.Number({
+ displayName: 'Domain ID',
+ description: 'Numeric domain ID. Get it from maileroo_list_domains.',
+ required: true,
+ }),
+ interaction_tracking: Property.StaticDropdown({
+ displayName: 'Open/Click Tracking',
+ description: 'Leave unset to keep the current value.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ custom_hostname_tracking: Property.StaticDropdown({
+ displayName: 'Custom Hostname Tracking',
+ description: 'Requires a paid plan. Leave unset to keep the current value.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ return_path: Property.ShortText({
+ displayName: 'Return Path',
+ description: 'Return-path local part, at most 24 characters.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { domain_id, interaction_tracking, custom_hostname_tracking, return_path } = context.propsValue;
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.PATCH,
+ path: `/domains/${encodeURIComponent(domain_id)}/settings`,
+ body: {
+ ...spreadIfDefined('interaction_tracking', mailerooClient.optionalBoolean(interaction_tracking)),
+ ...spreadIfDefined('custom_hostname_tracking', mailerooClient.optionalBoolean(custom_hostname_tracking)),
+ ...spreadIfDefined('return_path', return_path),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/ai/update-inbound-route.ts b/packages/pieces/community/maileroo/src/lib/actions/ai/update-inbound-route.ts
new file mode 100644
index 00000000000..b7504b66236
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/actions/ai/update-inbound-route.ts
@@ -0,0 +1,185 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property, spreadIfDefined } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../../auth';
+import { mailerooClient } from '../../common/client';
+import { mailerooInboundRouteOutputSchema } from '../../output-schemas';
+
+export const mailerooUpdateInboundRoute = createAction({
+ auth: mailerooAuth,
+ name: 'maileroo_update_inbound_route',
+ outputSchema: mailerooInboundRouteOutputSchema,
+ displayName: 'Update Inbound Route',
+ description: 'Updates an inbound route.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description: 'Changes an existing inbound route; only supplied fields change, the rest are read from the current route and re-sent because the vendor replaces the whole route. Get the route ID from maileroo_list_inbound_routes. Requires an Account Key connection.',
+ idempotent: true,
+ },
+ props: {
+ domain_id: Property.Number({
+ displayName: 'Domain ID',
+ description: 'Numeric domain ID. Get it from maileroo_list_domains.',
+ required: true,
+ }),
+ route_id: Property.ShortText({
+ displayName: 'Route ID',
+ description: 'Route ID from maileroo_list_inbound_routes.',
+ required: true,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: '3 to 255 characters.',
+ required: false,
+ }),
+ expression_type: Property.StaticDropdown({
+ displayName: 'Match Type',
+ description: 'How the route matches incoming mail.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Catch all', value: 'catch_all' },
+ { label: 'Match recipient', value: 'match_recipient' },
+ { label: 'Match header', value: 'match_header' },
+ { label: 'Custom expression', value: 'custom' },
+ ],
+ },
+ }),
+ forward_list: Property.Array({
+ displayName: 'Forward To',
+ description: 'Replaces the whole forward list.',
+ required: false,
+ }),
+ priority: Property.Number({
+ displayName: 'Priority',
+ description: '1 (highest) to 100 (lowest).',
+ required: false,
+ }),
+ recipient: Property.ShortText({
+ displayName: 'Recipient',
+ description: 'Required for Match recipient.',
+ required: false,
+ }),
+ header_name: Property.ShortText({
+ displayName: 'Header Name',
+ description: 'Required for Match header.',
+ required: false,
+ }),
+ header_content: Property.ShortText({
+ displayName: 'Header Content',
+ description: 'Required for Match header.',
+ required: false,
+ }),
+ custom_expression: Property.ShortText({
+ displayName: 'Custom Expression',
+ description: 'Required for Custom expression.',
+ required: false,
+ }),
+ regex_enabled: Property.StaticDropdown({
+ displayName: 'Regex',
+ description: 'Treat the expression content as a regular expression.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ dmarc_alignment: Property.StaticDropdown({
+ displayName: 'Require DMARC Alignment',
+ description: '',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ require_spf: Property.StaticDropdown({
+ displayName: 'Require SPF Pass',
+ description: '',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ require_dkim: Property.StaticDropdown({
+ displayName: 'Require DKIM Pass',
+ description: '',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ skip_spam_check: Property.StaticDropdown({
+ displayName: 'Skip Spam Check',
+ description: '',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ stop: Property.StaticDropdown({
+ displayName: 'Stop Processing',
+ description: 'Stop evaluating further routes when matched.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { domain_id, route_id, description, expression_type, forward_list, priority, recipient, header_name, header_content, custom_expression, regex_enabled, dmarc_alignment, require_spf, require_dkim, skip_spam_check, stop } = context.propsValue;
+ const path = `/domains/${encodeURIComponent(domain_id)}/inbound-routes/${encodeURIComponent(route_id)}`;
+ const current = await mailerooClient.accountRequest<Record<string, unknown>>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path,
+ });
+ const writable = mailerooClient.pickInboundRouteFields(current);
+ const changes = {
+ ...spreadIfDefined('description', description),
+ ...spreadIfDefined('expression_type', expression_type),
+ ...spreadIfDefined('forward_list', forward_list === undefined ? undefined : mailerooClient.toStrings(forward_list)),
+ ...spreadIfDefined('priority', priority),
+ ...spreadIfDefined('recipient', recipient),
+ ...spreadIfDefined('header_name', header_name),
+ ...spreadIfDefined('header_content', header_content),
+ ...spreadIfDefined('custom_expression', custom_expression),
+ ...spreadIfDefined('regex_enabled', mailerooClient.optionalBoolean(regex_enabled)),
+ ...spreadIfDefined('dmarc_alignment', mailerooClient.optionalBoolean(dmarc_alignment)),
+ ...spreadIfDefined('require_spf', mailerooClient.optionalBoolean(require_spf)),
+ ...spreadIfDefined('require_dkim', mailerooClient.optionalBoolean(require_dkim)),
+ ...spreadIfDefined('skip_spam_check', mailerooClient.optionalBoolean(skip_spam_check)),
+ ...spreadIfDefined('stop', mailerooClient.optionalBoolean(stop)),
+ };
+ return await mailerooClient.accountRequest({
+ auth: context.auth,
+ method: HttpMethod.PUT,
+ path,
+ body: { ...writable, ...changes },
+ });
+ },
+});
diff --git a/packages/pieces/community/maileroo/src/lib/actions/send-email.ts b/packages/pieces/community/maileroo/src/lib/actions/send-email.ts
index ec7cba4ba76..346dd6f2c85 100644
--- a/packages/pieces/community/maileroo/src/lib/actions/send-email.ts
+++ b/packages/pieces/community/maileroo/src/lib/actions/send-email.ts
@@ -11,7 +11,7 @@ export const sendEmail = createAction({
classification: 'WRITE',
displayName: 'Send Email',
description: 'Sends an email using the Maileroo API.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description: 'Sends a custom email through Maileroo with inline subject and body content (plain text or HTML), optionally with CC/BCC, reply-to, file attachments, and open/click tracking. Choose this to compose and deliver a one-off message; use the template action instead when the body comes from a saved Maileroo template. The sender address must belong to a verified domain, and the content type prop must match whether the content is plain or HTML. Not idempotent: each call dispatches a new email.',
idempotent: false,
diff --git a/packages/pieces/community/maileroo/src/lib/actions/send-from-template.ts b/packages/pieces/community/maileroo/src/lib/actions/send-from-template.ts
index a5482cb82e7..9c10fcc1127 100644
--- a/packages/pieces/community/maileroo/src/lib/actions/send-from-template.ts
+++ b/packages/pieces/community/maileroo/src/lib/actions/send-from-template.ts
@@ -4,10 +4,12 @@ import { spreadIfDefined } from '@activepieces/pieces-framework';
import { mailerooAuth } from '../auth';
import { buildAttachmentList, toEmailObjects } from '../common';
+import { mailerooSendFromTemplateOutputSchema } from '../output-schemas';
export const sendFromTemplate = createAction({
auth: mailerooAuth,
name: 'sendFromTemplate',
+ outputSchema: mailerooSendFromTemplateOutputSchema,
classification: 'WRITE',
displayName: 'Send Email using Template',
description: 'Sends an email from an existing template.',
diff --git a/packages/pieces/community/maileroo/src/lib/auth.ts b/packages/pieces/community/maileroo/src/lib/auth.ts
index 713aa295bdc..11e1c3b2f8c 100644
--- a/packages/pieces/community/maileroo/src/lib/auth.ts
+++ b/packages/pieces/community/maileroo/src/lib/auth.ts
@@ -9,6 +9,8 @@ For Sending API key, follow these steps:
4. Click **New Sending Key**.
5. Copy the key under the **Sending Key** column.
+For Account API key (used by the actions that manage domains, templates, suppressions, logs and statistics), create a key with the scopes you need in your Maileroo account settings.
+
For Verification API key, follow these steps:
1. Navigate to [Verification API](https://app.maileroo.com/verifications).
2. Copy the key under the **Verification API** section.
@@ -31,6 +33,10 @@ export const mailerooAuth = PieceAuth.CustomAuth({
label: 'Verification Key',
value: 'verification',
},
+ {
+ label: 'Account Key',
+ value: 'account',
+ },
],
},
required: true,
@@ -80,6 +86,23 @@ export const mailerooAuth = PieceAuth.CustomAuth({
return {
valid: true,
};
+ } else if (auth.keyType === 'account') {
+ try {
+ await httpClient.sendRequest({
+ method: HttpMethod.GET,
+ url: 'https://api.maileroo.com/v1/statistics/summary',
+ headers: { Authorization: `Bearer ${auth.apiKey}` },
+ });
+ return { valid: true };
+ } catch (e) {
+ if (e instanceof HttpError && e.response.status === 401) {
+ return { valid: false, error: 'Invalid Account API key' };
+ }
+ if (e instanceof HttpError && e.response.status === 403 && (JSON.stringify(e.response.body) ?? '').includes('scope')) {
+ return { valid: true };
+ }
+ return { valid: false, error: 'Could not validate the Account API key. Check the key and try again.' };
+ }
} else {
const result = await httpClient.sendRequest({
url: 'https://verify.maileroo.net/check',
diff --git a/packages/pieces/community/maileroo/src/lib/common/client.ts b/packages/pieces/community/maileroo/src/lib/common/client.ts
new file mode 100644
index 00000000000..829b4240d0c
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/common/client.ts
@@ -0,0 +1,128 @@
+import { HttpError, HttpMethod, httpClient } from '@activepieces/pieces-common';
+import { AppConnectionValueForAuthProperty, isNil } from '@activepieces/pieces-framework';
+
+import { mailerooAuth } from '../auth';
+
+const ACCOUNT_BASE_URL = 'https://api.maileroo.com/v1';
+const INBOUND_ROUTE_FIELDS = [
+ 'description',
+ 'expression_type',
+ 'header_name',
+ 'header_content',
+ 'recipient',
+ 'custom_expression',
+ 'regex_enabled',
+ 'forward_list',
+ 'dmarc_alignment',
+ 'require_spf',
+ 'require_dkim',
+ 'skip_spam_check',
+ 'stop',
+ 'priority',
+];
+const EMAIL_BASE_URL = 'https://smtp.maileroo.com/api/v2';
+
+async function accountRequest<T>({ auth, method, path, queryParams, body }: AccountRequest): Promise<T | { success: true }> {
+ assertKeyType({ auth, expected: 'account', label: 'Account Key' });
+ const response = await send<{ data?: T }>({
+ method,
+ url: `${ACCOUNT_BASE_URL}${path}`,
+ headers: { Authorization: `Bearer ${auth.props.apiKey}`, 'Content-Type': 'application/json' },
+ queryParams,
+ body,
+ });
+ return isNil(response.data) ? { success: true } : response.data;
+}
+
+async function emailRequest<T>({ auth, method, path, queryParams, body }: AccountRequest): Promise<EmailEnvelope<T>> {
+ assertKeyType({ auth, expected: 'sending', label: 'Sending Key' });
+ const response = await send<EmailEnvelope<T>>({
+ method,
+ url: `${EMAIL_BASE_URL}${path}`,
+ headers: { 'X-API-Key': auth.props.apiKey, 'Content-Type': 'application/json' },
+ queryParams,
+ body,
+ });
+ if (response.success === false) {
+ throw new Error(response.message);
+ }
+ return response;
+}
+
+function toQuery(values: Record<string, string | number | undefined>): Record<string, string> {
+ return Object.fromEntries(
+ Object.entries(values)
+ .filter((entry): entry is [string, string | number] => !isNil(entry[1]))
+ .map(([key, value]) => [key, String(value)]),
+ );
+}
+
+function optionalBoolean(value: string | undefined): boolean | undefined {
+ if (value === 'true') return true;
+ if (value === 'false') return false;
+ return undefined;
+}
+
+function toStrings(values: unknown[]): string[] {
+ return values.filter((value): value is string => typeof value === 'string');
+}
+
+function pickInboundRouteFields(route: Record<string, unknown>): Record<string, unknown> {
+ return Object.fromEntries(INBOUND_ROUTE_FIELDS.filter((field) => field in route).map((field) => [field, route[field]]));
+}
+
+async function send<T>({ method, url, headers, queryParams, body }: SendRequest): Promise<T> {
+ try {
+ const response = await httpClient.sendRequest<T>({ method, url, headers, queryParams, body });
+ return response.body;
+ } catch (error) {
+ throw toReadableError(error);
+ }
+}
+
+function toReadableError(error: unknown): Error {
+ if (!(error instanceof HttpError)) {
+ return error instanceof Error ? error : new Error(String(error));
+ }
+ const status = error.response.status;
+ const payload = error.response.body;
+ const vendorMessage = extractMessage(payload);
+ return new Error(`Maileroo API error ${status}: ${vendorMessage}`);
+}
+
+function extractMessage(payload: unknown): string {
+ if (typeof payload === 'object' && !isNil(payload)) {
+ if ('error' in payload && typeof payload.error === 'object' && !isNil(payload.error) && 'message' in payload.error) {
+ return String(payload.error.message);
+ }
+ if ('message' in payload) {
+ return String(payload.message);
+ }
+ }
+ return typeof payload === 'string' ? payload : 'Unknown error';
+}
+
+function assertKeyType({ auth, expected, label }: { auth: MailerooAuth; expected: 'sending' | 'account'; label: string }): void {
+ if (auth.props.keyType !== expected) {
+ throw new Error(`This action requires a connection with a ${label}. Reconnect Maileroo and choose "${label}" as the key type.`);
+ }
+}
+
+export const mailerooClient = { accountRequest, emailRequest, toQuery, optionalBoolean, toStrings, pickInboundRouteFields };
+
+export type MailerooAuth = AppConnectionValueForAuthProperty<typeof mailerooAuth>;
+export type EmailEnvelope<T> = { success: boolean; message: string; data: T };
+type AccountRequest = {
+ auth: MailerooAuth;
+ method: HttpMethod;
+ path: string;
+ queryParams?: Record<string, string>;
+ body?: Record<string, unknown>;
+};
+type SendRequest = {
+ method: HttpMethod;
+ url: string;
+ headers: Record<string, string>;
+ queryParams?: Record<string, string>;
+ body?: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/maileroo/src/lib/common/props.ts b/packages/pieces/community/maileroo/src/lib/common/props.ts
new file mode 100644
index 00000000000..bd0f1661be7
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/common/props.ts
@@ -0,0 +1,63 @@
+import { Property, spreadIfDefined } from '@activepieces/pieces-framework';
+
+function buildLogFilters(values: LogFilterValues): Record<string, unknown> {
+ const { message_id, reference_id, subject, sender, recipient, log_type, sort_dir, datetime_from, datetime_to } = values;
+ return {
+ ...spreadIfDefined('message_id', message_id),
+ ...spreadIfDefined('reference_id', reference_id),
+ ...spreadIfDefined('subject', subject),
+ ...spreadIfDefined('sender', sender),
+ ...spreadIfDefined('recipient', recipient),
+ ...spreadIfDefined('log_type', log_type),
+ ...spreadIfDefined('sort_dir', sort_dir === undefined ? undefined : Number(sort_dir)),
+ ...spreadIfDefined('datetime_from', datetime_from),
+ ...spreadIfDefined('datetime_to', datetime_to),
+ };
+}
+
+export const mailerooProps = {
+ tracking: Property.StaticDropdown({
+ displayName: 'Open/Click Tracking',
+ description: 'Leave unset to use the account setting.',
+ required: false,
+ options: { disabled: false, options: [{ label: 'Yes', value: 'true' }, { label: 'No', value: 'false' }] },
+ }),
+ logFilters: {
+ message_id: Property.ShortText({ displayName: 'Message ID', description: 'Match a specific message ID.', required: false }),
+ reference_id: Property.ShortText({ displayName: 'Reference ID', description: 'Match a reference ID returned by a send action.', required: false }),
+ subject: Property.ShortText({ displayName: 'Subject', description: 'Match the subject.', required: false }),
+ sender: Property.ShortText({ displayName: 'Sender', description: 'Match the sender address.', required: false }),
+ recipient: Property.ShortText({ displayName: 'Recipient', description: 'Match the recipient address.', required: false }),
+ log_type: Property.StaticDropdown({
+ displayName: 'Event Type',
+ description: 'Filter by event type.',
+ required: false,
+ options: {
+ disabled: false,
+ options: ['Delivered', 'Deferred', 'Suppressed', 'Bounced', 'Complained'].map((value) => ({ label: value, value })),
+ },
+ }),
+ sort_dir: Property.StaticDropdown({
+ displayName: 'Sort Order',
+ description: 'Newest first by default.',
+ required: false,
+ options: { disabled: false, options: [{ label: 'Newest first', value: '-1' }, { label: 'Oldest first', value: '1' }] },
+ }),
+ datetime_from: Property.Number({ displayName: 'From (Unix Timestamp)', description: 'Only events at or after this Unix timestamp.', required: false }),
+ datetime_to: Property.Number({ displayName: 'To (Unix Timestamp)', description: 'Only events at or before this Unix timestamp.', required: false }),
+ page: Property.Number({ displayName: 'Page', description: 'Page number, starting at 1.', required: false }),
+ },
+ buildLogFilters,
+};
+
+type LogFilterValues = {
+ message_id?: string;
+ reference_id?: string;
+ subject?: string;
+ sender?: string;
+ recipient?: string;
+ log_type?: string;
+ sort_dir?: string;
+ datetime_from?: number;
+ datetime_to?: number;
+};
diff --git a/packages/pieces/community/maileroo/src/lib/output-schemas.ts b/packages/pieces/community/maileroo/src/lib/output-schemas.ts
new file mode 100644
index 00000000000..ab68ac6baa3
--- /dev/null
+++ b/packages/pieces/community/maileroo/src/lib/output-schemas.ts
@@ -0,0 +1,429 @@
+import { OutputSchema } from '@activepieces/pieces-framework';
+
+const aggregateFields: OutputSchema['fields'] = [
+ { key: 'delivered', label: 'Delivered', format: 'number' },
+ { key: 'bounced', label: 'Bounced', format: 'number' },
+ { key: 'opens', label: 'Opens', format: 'number' },
+ { key: 'clicks', label: 'Clicks', format: 'number' },
+ { key: 'suppressions', label: 'Suppressions', format: 'number' },
+];
+
+const statisticsFields: OutputSchema['fields'] = [
+ { key: 'delivered', label: 'Delivered', format: 'number' },
+ { key: 'bounced', label: 'Bounced', format: 'number' },
+ { key: 'opened', label: 'Opened', format: 'number' },
+ { key: 'clicked', label: 'Clicked', format: 'number' },
+];
+
+const inboundRouteFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'user_id', label: 'User ID', format: 'number' },
+ { key: 'domain_id', label: 'Domain ID', format: 'number' },
+ { key: 'domain_name', label: 'Domain Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'expression_type', label: 'Expression Type' },
+ { key: 'header_name', label: 'Header Name' },
+ { key: 'header_content', label: 'Header Content' },
+ { key: 'recipient', label: 'Recipient', format: 'email' },
+ { key: 'custom_expression', label: 'Custom Expression' },
+ { key: 'regex_enabled', label: 'Regex Enabled', format: 'boolean' },
+ { key: 'forward_list', label: 'Forward List' },
+ { key: 'dmarc_alignment', label: 'DMARC Alignment', format: 'boolean' },
+ { key: 'require_spf', label: 'Require SPF', format: 'boolean' },
+ { key: 'require_dkim', label: 'Require DKIM', format: 'boolean' },
+ { key: 'skip_spam_check', label: 'Skip Spam Check', format: 'boolean' },
+ { key: 'stop', label: 'Stop', format: 'boolean' },
+ { key: 'priority', label: 'Priority', format: 'number' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+];
+
+export const mailerooGetStatisticsSummaryOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'aggregate',
+ label: 'Aggregate',
+ children: aggregateFields,
+ },
+ { key: 'country_data', label: 'Country Data' },
+ ],
+};
+
+export const mailerooListDomainsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'domains',
+ label: 'Domains',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'domain_name', label: 'Domain Name' },
+ {
+ key: 'statistics',
+ label: 'Statistics',
+ children: statisticsFields,
+ },
+ { key: 'status', label: 'Status', format: 'boolean' },
+ ],
+ },
+ { key: 'total', label: 'Total', format: 'number' },
+ { key: 'page', label: 'Page', format: 'number' },
+ { key: 'per_page', label: 'Per Page', format: 'number' },
+ { key: 'total_pages', label: 'Total Pages', format: 'number' },
+ ],
+};
+
+export const mailerooListSuppressionsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'suppressions',
+ label: 'Suppressions',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'email_address', label: 'Email Address', format: 'email' },
+ { key: 'reason', label: 'Reason' },
+ ],
+ },
+ { key: 'total', label: 'Total', format: 'number' },
+ { key: 'page', label: 'Page', format: 'number' },
+ { key: 'per_page', label: 'Per Page', format: 'number' },
+ { key: 'total_pages', label: 'Total Pages', format: 'number' },
+ ],
+};
+
+export const mailerooListTemplatesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'templates',
+ label: 'Templates',
+ value: '',
+ listItems: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'preview_image', label: 'Preview Image' },
+ { key: 'preview_url', label: 'Preview URL' },
+ { key: 'processed', label: 'Processed', format: 'number' },
+ ],
+ },
+ ],
+ itemLabel: '{template_name}',
+};
+
+export const mailerooGetDomainAnalyticsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'aggregate',
+ label: 'Aggregate',
+ children: aggregateFields,
+ },
+ {
+ key: 'timeline',
+ label: 'Timeline',
+ listItems: [
+ { key: 'date', label: 'Date', format: 'date' },
+ {
+ key: 'totals',
+ label: 'Totals',
+ children: aggregateFields,
+ },
+ ],
+ },
+ {
+ key: 'service_providers',
+ label: 'Service Providers',
+ labelKey: 'name',
+ listItems: [
+ { key: 'name', label: 'Name' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const mailerooDomainOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'user_id', label: 'User ID', format: 'number' },
+ { key: 'domain_name', label: 'Domain Name' },
+ {
+ key: 'dns_records',
+ label: 'DNS Records',
+ children: [
+ {
+ key: 'dkim_record',
+ label: 'DKIM Record',
+ children: [
+ { key: 'host', label: 'Host' },
+ { key: 'record', label: 'Record' },
+ { key: 'cname_fallback', label: 'CNAME Fallback' },
+ { key: 'created', label: 'Created', format: 'boolean' },
+ ],
+ },
+ {
+ key: 'spf_record',
+ label: 'SPF Record',
+ children: [
+ { key: 'host', label: 'Host' },
+ { key: 'record', label: 'Record' },
+ { key: 'created', label: 'Created', format: 'boolean' },
+ ],
+ },
+ {
+ key: 'dmarc_record',
+ label: 'DMARC Record',
+ children: [
+ { key: 'host', label: 'Host' },
+ { key: 'record', label: 'Record' },
+ { key: 'created', label: 'Created', format: 'boolean' },
+ ],
+ },
+ {
+ key: 'mx_record',
+ label: 'MX Record',
+ listItems: [
+ { key: 'host', label: 'Host' },
+ { key: 'record', label: 'Record' },
+ { key: 'priority', label: 'Priority', format: 'number' },
+ { key: 'created', label: 'Created', format: 'boolean' },
+ ],
+ },
+ {
+ key: 'tracking_record',
+ label: 'Tracking Record',
+ children: [
+ { key: 'host', label: 'Host' },
+ { key: 'record', label: 'Record' },
+ { key: 'created', label: 'Created', format: 'boolean' },
+ ],
+ },
+ ],
+ },
+ { key: 'sandbox', label: 'Sandbox', format: 'boolean' },
+ { key: 'free', label: 'Free', format: 'boolean' },
+ { key: 'interaction_tracking', label: 'Interaction Tracking', format: 'boolean' },
+ { key: 'custom_hostname_tracking', label: 'Custom Hostname Tracking', format: 'boolean' },
+ { key: 'return_path', label: 'Return Path' },
+ { key: 'status', label: 'Status', format: 'boolean' },
+ {
+ key: 'statistics',
+ label: 'Statistics',
+ children: statisticsFields,
+ },
+ ],
+};
+
+export const mailerooSearchDomainEmailLogsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Items',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'message_id', label: 'Message ID' },
+ { key: 'reference_id', label: 'Reference ID' },
+ { key: 'instance_id', label: 'Instance ID', format: 'number' },
+ { key: 'ip_address', label: 'IP Address' },
+ { key: 'application_id', label: 'Application ID', format: 'number' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'sender', label: 'Sender', format: 'email' },
+ { key: 'recipients', label: 'Recipients' },
+ {
+ key: 'tags',
+ label: 'Tags',
+ labelKey: 'name',
+ listItems: [
+ { key: 'name', label: 'Name' },
+ { key: 'value', label: 'Value' },
+ ],
+ },
+ {
+ key: 'events',
+ label: 'Events',
+ listItems: [
+ { key: 'event_type', label: 'Event Type' },
+ { key: 'timestamp', label: 'Timestamp', format: 'number' },
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'recipient', label: 'Recipient', format: 'email' },
+ ],
+ },
+ ],
+ },
+ { key: 'datetime', label: 'Datetime', format: 'datetime' },
+ ],
+ },
+ { key: 'page', label: 'Page', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ ],
+};
+
+export const mailerooGetEmailLogOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'from', label: 'From', format: 'email' },
+ { key: 'to', label: 'To' },
+ { key: 'raw_email', label: 'Raw Email' },
+ { key: 'collected_on', label: 'Collected On', format: 'datetime' },
+ ],
+};
+
+export const mailerooRenderEmailLogOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'url', label: 'URL', format: 'url' },
+ ],
+};
+
+export const mailerooResendEmailOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'reference_id', label: 'Reference ID' },
+ ],
+};
+
+export const mailerooInboundRouteOutputSchema: OutputSchema = {
+ fields: inboundRouteFields,
+};
+
+export const mailerooListInboundRoutesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Items',
+ labelKey: 'id',
+ listItems: inboundRouteFields,
+ },
+ { key: 'page', label: 'Page', format: 'number' },
+ { key: 'total_pages', label: 'Total Pages', format: 'number' },
+ ],
+};
+
+export const mailerooSendBulkEmailsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ { key: 'reference_ids', label: 'Reference IDs' },
+ ],
+};
+
+export const mailerooListScheduledEmailsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'page', label: 'Page', format: 'number' },
+ { key: 'per_page', label: 'Per Page', format: 'number' },
+ {
+ key: 'results',
+ label: 'Results',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'from', label: 'From' },
+ { key: 'recipients', label: 'Recipients' },
+ { key: 'reference_id', label: 'Reference ID' },
+ { key: 'scheduled_at', label: 'Scheduled At', format: 'datetime' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'tags', label: 'Tags' },
+ ],
+ },
+ { key: 'total_count', label: 'Total Count', format: 'number' },
+ { key: 'total_pages', label: 'Total Pages', format: 'number' },
+ ],
+};
+
+export const mailerooSendEmailOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ { key: 'reference_id', label: 'Reference ID' },
+ ],
+};
+
+export const mailerooSendFromTemplateOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'reference_id', label: 'Reference ID' },
+ ],
+ },
+ { key: 'message', label: 'Message' },
+ { key: 'success', label: 'Success', format: 'boolean' },
+ ],
+};
+
+export const mailerooGetStatisticsTimelineOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'timeline',
+ label: 'Timeline',
+ value: '',
+ listItems: [
+ { key: 'date', label: 'Date', format: 'date' },
+ {
+ key: 'summary',
+ label: 'Summary',
+ children: [
+ {
+ key: 'aggregate',
+ label: 'Aggregate',
+ children: aggregateFields,
+ },
+ { key: 'country_data', label: 'Country Data' },
+ ],
+ },
+ ],
+ },
+ ],
+ itemLabel: '{date}',
+};
+
+export const mailerooCreateSuppressionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'email_address', label: 'Email Address', format: 'email' },
+ { key: 'reason', label: 'Reason' },
+ ],
+};
+
+export const mailerooCreateTemplateOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'preview_image', label: 'Preview Image' },
+ { key: 'preview_url', label: 'Preview URL' },
+ { key: 'processed', label: 'Processed', format: 'number' },
+ ],
+};
+
+export const mailerooGetTemplateOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID', format: 'number' },
+ { key: 'type', label: 'Type' },
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'preview_image', label: 'Preview Image' },
+ { key: 'preview_url', label: 'Preview URL' },
+ { key: 'processed', label: 'Processed', format: 'number' },
+ { key: 'html', label: 'HTML' },
+ { key: 'plaintext', label: 'Plaintext' },
+ ],
+};
+
+export const mailerooUpdateDomainSettingsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'interaction_tracking', label: 'Interaction Tracking', format: 'boolean' },
+ { key: 'custom_hostname_tracking', label: 'Custom Hostname Tracking', format: 'boolean' },
+ { key: 'return_path', label: 'Return Path' },
+ ],
+};
+
+export const mailerooSuccessOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ ],
+};
+
+export const mailerooDeleteScheduledEmailOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ ],
+};