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 +10 -0
- package/dist/index.cjs +5 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2088,20 +2088,18 @@ var BroadcastProvider = class {
|
|
|
2088
2088
|
name: this.fromName
|
|
2089
2089
|
};
|
|
2090
2090
|
const recipients = Array.isArray(params.to) ? params.to : [params.to];
|
|
2091
|
-
const response = await fetch(`${this.apiUrl}/api/v1/
|
|
2091
|
+
const response = await fetch(`${this.apiUrl}/api/v1/transactionals.json`, {
|
|
2092
2092
|
method: "POST",
|
|
2093
2093
|
headers: {
|
|
2094
2094
|
"Authorization": `Bearer ${this.token}`,
|
|
2095
2095
|
"Content-Type": "application/json"
|
|
2096
2096
|
},
|
|
2097
2097
|
body: JSON.stringify({
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
to: recipients,
|
|
2098
|
+
to: recipients[0],
|
|
2099
|
+
// Broadcast API expects a single recipient for transactional emails
|
|
2101
2100
|
subject: params.subject,
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
reply_to: params.replyTo
|
|
2101
|
+
body: params.html || params.text || "",
|
|
2102
|
+
reply_to: params.replyTo || from.email
|
|
2105
2103
|
})
|
|
2106
2104
|
});
|
|
2107
2105
|
if (!response.ok) {
|