PWI Software Documentation Help

Automated Email API

Send an email. The email contains a standard footer indicating that the email was sent by an automated system. It uses a basic MJML template to format the email nicely in all email clients. If the reply-to is not specified or is specified as bot@pwiworks.com, the footer includes a note indicating that replies are not monitored.

/send-email

Request parameters

{ "to": [ [ "recipient1@example.com", "recipient2@example.com" ] ], "cc": [ [ "cc1@example.com", "cc2@example.com" ] ], "bcc": [ [ "bcc1@example.com", "bcc2@example.com" ] ], "from": { "name": "PWI Portal", "email": "portal@pwiworks.com" }, "subject": "Please Read", "body": "Hi, friend! This is an email from PWI.", "replyTo": "bot@pwiworks.com", "cta": { "text": "View Help", "url": "help.pwiworks.app" }, "debugInfo": "https://some-automation-url.auto", "parseBodyAsMarkdown": "false" }

Responses

Authorization

Include the X-API-Key header with the api key in your request. The API key is stored as a variable in the Make scenario.

TypeScript Interfaces

Use these interfaces in your TypeScript application to format your request body.

type AllowedSendFrom = | "portal@pwiworks.com" | "automations@pwiworks.com" | "live-pricing@pwiworks.com" | "marketing@pwiworks.com" | "shipping@pwiworks.com"; interface EmailData { to: string[]; cc?: string[]; bcc?: string[]; from?: { name?: string; email?: AllowedSendFrom; }; subject: string; body: string; replyTo?: string; cta?: { text: string; url: string; }; debugInfo?: string; }

Example Request

// get input from the Airtable script action // input variables must be defined in Airtable const myInput = input.config(); // define the email data const emailData = { to: myInput.to, cc: myInput.cc, from: { name: "PWI Portal", email: "portal@pwiworks.com" }, subject: `[Portal] Please Review ${myInput.title}`, body: `<p>Hi, ${myInput.reviewer}</p><p>${myInput.submitter} has ` +`submitted a new request for you to review. Please review ` +`this at your earliest convenience.</p>`, replyTo: myInput.requesterEmail, cta: { text: "Review Request", url: "https://example.com" }, debugInfo: `Airtable automation https://airtable.com/automation-path`, parseBodyAsMarkdown: false, }; // post the email data to the API const response = await fetch('https://api.example.com/send-email', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': '<api-key>' }, body: JSON.stringify(emailData) }); // check the response and throw an error as needed if (response.ok) { console.log('Email sent successfully'); } else { console.error('Failed to send email', await response.text()); }
curl -X POST https://api.example.com/send-email \ -H "Content-Type: application/json" \ -H "X-API-Key: <api-key>" \ -d '{ "to": ["recipient@example.com"], "cc": ["cc@example.com"], "bcc": ["bcc@example.com"], "from": { "name": "PWI Portal", "email": "portal@pwiworks.com" }, "subject": "Your Subject Here", "body": "This is the email body content.", "replyTo": "reply@example.com", "cta": { "text": "Click here", "url": "https://example.com" }, "debugInfo": "sourceAutomation.com", "parseBodyAsMarkdown": false }'

Tech Stack

This API is built using the Make platform. Internal users can access the scenario in Make here. You must access the scenario to find the webhook URL and API key.

14 November 2025