mailtruss 0.1.0 → 0.1.1
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/dist/index.d.ts +7 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ export type SendEmailParams = {
|
|
|
28
28
|
id: string;
|
|
29
29
|
variables?: Record<string, unknown>;
|
|
30
30
|
};
|
|
31
|
+
/** `false` (or `{ clicks: false, opens: false }`) switches click and open tracking off for this message. It cannot switch on what the domain has off. */
|
|
32
|
+
tracking?: boolean | {
|
|
33
|
+
clicks?: boolean;
|
|
34
|
+
opens?: boolean;
|
|
35
|
+
};
|
|
31
36
|
};
|
|
32
37
|
export type Email = {
|
|
33
38
|
object: "email";
|
|
@@ -160,10 +165,12 @@ export declare class MailClient {
|
|
|
160
165
|
setTracking: (id: string, p: {
|
|
161
166
|
click_tracking?: boolean;
|
|
162
167
|
open_tracking?: boolean;
|
|
168
|
+
tracking_scope?: "all" | "broadcasts";
|
|
163
169
|
}, o?: RequestOptions) => Promise<{
|
|
164
170
|
id: string;
|
|
165
171
|
click_tracking: boolean;
|
|
166
172
|
open_tracking: boolean;
|
|
173
|
+
tracking_scope: "all" | "broadcasts";
|
|
167
174
|
}>;
|
|
168
175
|
remove: (id: string, o?: RequestOptions) => Promise<{
|
|
169
176
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ export class MailClient {
|
|
|
35
35
|
try {
|
|
36
36
|
const res = await f(`${base}${path}`, {
|
|
37
37
|
method, signal: ctl.signal,
|
|
38
|
-
headers: { Authorization: `Bearer ${this.o.apiKey}`, "Content-Type": "application/json", "User-Agent": "mailtruss-node/0.1.
|
|
38
|
+
headers: { Authorization: `Bearer ${this.o.apiKey}`, "Content-Type": "application/json", "User-Agent": "mailtruss-node/0.1.1", ...(opts.idempotencyKey ? { "Idempotency-Key": opts.idempotencyKey } : {}) },
|
|
39
39
|
body: body === undefined ? undefined : JSON.stringify(body),
|
|
40
40
|
});
|
|
41
41
|
const json = (await res.json().catch(() => null));
|