payload-plugin-newsletter 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [0.9.2] - 2025-07-20
2
+
3
+ ### Fixed
4
+ - Fixed Broadcast provider to use correct API endpoint for transactional emails
5
+ - Changed endpoint from `/api/v1/emails` to `/api/v1/transactionals.json`
6
+ - Updated request body format to match Broadcast API documentation
7
+ - Fixed handling of single recipient (Broadcast expects single recipient for transactional emails)
8
+ - Adjusted reply_to field to use correct format
9
+ - This resolves issues with sending emails through the Broadcast provider
10
+
1
11
  ## [0.9.1] - 2025-07-04
2
12
 
3
13
  ### Fixed
package/dist/index.cjs CHANGED
@@ -2105,20 +2105,18 @@ var BroadcastProvider = class {
2105
2105
  name: this.fromName
2106
2106
  };
2107
2107
  const recipients = Array.isArray(params.to) ? params.to : [params.to];
2108
- const response = await fetch(`${this.apiUrl}/api/v1/emails`, {
2108
+ const response = await fetch(`${this.apiUrl}/api/v1/transactionals.json`, {
2109
2109
  method: "POST",
2110
2110
  headers: {
2111
2111
  "Authorization": `Bearer ${this.token}`,
2112
2112
  "Content-Type": "application/json"
2113
2113
  },
2114
2114
  body: JSON.stringify({
2115
- from_email: from.email,
2116
- from_name: from.name,
2117
- to: recipients,
2115
+ to: recipients[0],
2116
+ // Broadcast API expects a single recipient for transactional emails
2118
2117
  subject: params.subject,
2119
- html_body: params.html,
2120
- text_body: params.text,
2121
- reply_to: params.replyTo
2118
+ body: params.html || params.text || "",
2119
+ reply_to: params.replyTo || from.email
2122
2120
  })
2123
2121
  });
2124
2122
  if (!response.ok) {