From 878ff91c30e4f1f9a4461fc07fdd9e57d5d4a9b8 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Fri, 1 May 2026 15:53:05 -0400 Subject: [PATCH] feat(api): migrate send_email to v3 action endpoint --- .../GUIDE__AE_API_V3_for_Frontend.md | 41 +++++++++++++++++-- src/lib/api/api.ts | 11 ++--- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/documentation/GUIDE__AE_API_V3_for_Frontend.md b/documentation/GUIDE__AE_API_V3_for_Frontend.md index b1d157d7..fcdff048 100644 --- a/documentation/GUIDE__AE_API_V3_for_Frontend.md +++ b/documentation/GUIDE__AE_API_V3_for_Frontend.md @@ -316,7 +316,42 @@ Frontend guidance: --- -## Axonius Zoom CSV Upload (Temporary — Apr 2026) +## 8. Email Send Action + +Send a transactional email via the Aether API. + +- **Method:** `POST` +- **Path:** `/v3/action/email/send` +- **Auth:** `x-aether-api-key` + `x-account-id` (or `x-no-account-id` / `?jwt=`) + +**Request body:** +```json +{ + "from_email": "noreply@example.com", + "from_name": "Example App", + "to_email": "user@example.com", + "to_name": "Alice Smith", + "subject": "Your login link", + "body_html": "

Click here to log in.

", + "body_text": "Visit ... to log in.", + "cc_email": null, + "bcc_email": null +} +``` + +**Query params:** + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `test` | bool | `false` | Simulate send without delivering | + +**Response:** `data` contains `{ from_email, to_email, subject }` (first 40 chars of subject). `400` if delivery failed. + +> **Replaces:** `POST /util/email/send` (disabled as of May 2026). + +--- + +## Axonius Zoom CSV Upload (Temporary — Apr 2026, EXPIRED) Purpose: Staff-only quick upload to upsert Event Person + Event Badge records from a Zoom Events registrant CSV. @@ -535,7 +570,7 @@ Results are automatically scoped to the `x-account-id` provided in the request. --- -## 9. Event Exhibit Tracking Export (Leads Export) +## 10. Event Exhibit Tracking Export (Leads Export) Allows an exhibitor to download all lead-capture records for their exhibit as a CSV or XLSX file. @@ -603,7 +638,7 @@ const url = URL.createObjectURL(blob); --- -## 10. Troubleshooting 403 Forbidden +## 11. Troubleshooting 403 Forbidden If you receive a 403 on a valid ID: 1. Verify `x-aether-api-key` is correct. diff --git a/src/lib/api/api.ts b/src/lib/api/api.ts index e55b23fc..b10291f5 100644 --- a/src/lib/api/api.ts +++ b/src/lib/api/api.ts @@ -565,7 +565,7 @@ export const get_data_store_obj_w_code = /* BEGIN: Utility: Email Related */ -// Updated 2023-06-29 +// Updated 2026-05-01 — migrated to the V3 action endpoint export const send_email = async function send_email({ api_cfg, from_email, @@ -621,7 +621,7 @@ export const send_email = async function send_email({ return null; } - const endpoint = `/util/email/send`; + const endpoint = `/v3/action/email/send`; data['from_email'] = from_email; // Required data['from_name'] = from_name; @@ -664,11 +664,8 @@ export const send_email = async function send_email({ if (log_lvl > 1) { console.log('Response Data:', send_email_post_promise); } - if (return_obj) { - return send_email_post_promise; - } else { - return send_email_post_promise.event_abstract_id_random; - } + + return send_email_post_promise; }; /* END: Utility: Email Related */