mailgun.js 5.0.4 → 5.0.5

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
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [5.0.5](https://github.com/mailgun/mailgun.js/compare/v5.0.4...v5.0.5) (2022-03-31)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Add types to message create method ([5c31628](https://github.com/mailgun/mailgun.js/commits/5c31628f7adbafbfb8fb7283076b64448d10226d))
11
+
5
12
  ### [5.0.4](https://github.com/mailgun/mailgun.js/compare/v5.0.3...v5.0.4) (2022-03-29)
6
13
 
7
14
 
@@ -0,0 +1,165 @@
1
+ export declare type MailgunMessageData = {
2
+ /**
3
+ * Email address for `From` header
4
+ */
5
+ from?: string;
6
+ /**
7
+ * Email address of the recipient(s).
8
+ *
9
+ * @example `Bob <bob@host.com>`. You can use commas to separate multiple recipients.
10
+ */
11
+ to?: string;
12
+ /**
13
+ * Same as `To` but for `carbon copy`
14
+ */
15
+ cc?: string;
16
+ /**
17
+ * Same as `To` but for `blind carbon copy`
18
+ */
19
+ bcc?: string;
20
+ /**
21
+ * Message subject
22
+ */
23
+ subject?: string;
24
+ /**
25
+ * Body of the message. (text version)
26
+ */
27
+ text?: string;
28
+ /**
29
+ * Body of the message. (HTML version)
30
+ */
31
+ html?: string;
32
+ /**
33
+ * [AMP](https://developers.google.com/gmail/ampemail/) part of the message. Please follow google guidelines to compose and send AMP emails.
34
+ */
35
+ 'amp-html'?: string;
36
+ /**
37
+ * File attachment. You can post multiple `attachment` values.
38
+ *
39
+ * **Important:** You must use `multipart/form-data` encoding when sending attachments.
40
+ */
41
+ attachment?: any;
42
+ /**
43
+ * Attachment with `inline` disposition. Can be used to send inline images (see example).
44
+ *
45
+ * You can post multiple `inline` values.
46
+ */
47
+ inline?: any;
48
+ /**
49
+ * Name of a template stored via [template API](https://documentation.mailgun.com/en/latest/api-templates.html#api-templates). See [Templates](https://documentation.mailgun.com/en/latest/user_manual.html#templating) for more information
50
+ */
51
+ template?: string;
52
+ /**
53
+ * Use this parameter to send a message to specific version of a template
54
+ */
55
+ 't:version'?: string;
56
+ /**
57
+ * Pass `yes` if you want to have rendered template
58
+ * in the text part of the message in case of template sending
59
+ */
60
+ 't:text'?: boolean | 'yes' | 'no';
61
+ /**
62
+ * Tag string. See [Tagging](https://documentation.mailgun.com/en/latest/user_manual.html#tagging) for more information.
63
+ */
64
+ 'o:tag'?: string | string[];
65
+ /**
66
+ * Enables/disables DKIM signatures on per-message basis. Pass `yes`, `no`, `true` or `false`
67
+ */
68
+ 'o:dkim'?: boolean | 'yes' | 'no';
69
+ /**
70
+ * Desired time of delivery. See [Date Format](https://documentation.mailgun.com/en/latest/api-intro.html#date-format).
71
+ *
72
+ * Note: Messages can be scheduled for a maximum of 3 days in the future.
73
+ */
74
+ 'o:deliverytime'?: string;
75
+ /**
76
+ * Toggles Send Time Optimization (STO) on a per-message basis.
77
+ *
78
+ * String should be set to the number of hours in `[0-9]+h` format,
79
+ * with the minimum being `24h` and the maximum being `72h`.
80
+ *
81
+ * This value defines the time window in which Mailgun will run the optimization algorithm based on prior engagement data of a given recipient. See [Sending a message with STO](https://documentation.mailgun.com/en/latest/user_manual.html#sto-sending) for details.
82
+ *
83
+ * _Please note that STO is only available on certain plans.
84
+ * See www.mailgun.com/pricing for more info._
85
+ */
86
+ 'o:deliverytime-optimize-period'?: string;
87
+ /**
88
+ * Toggles Timezone Optimization (TZO) on a per message basis.
89
+ *
90
+ * String should be set to preferred delivery time in `HH:mm` or `hh:mmaa` format, where `HH:mm` is used for 24 hour format without AM/PM and `hh:mmaa` is used for 12 hour format with AM/PM. See [Sending a message with TZO](https://documentation.mailgun.com/en/latest/user_manual.html#tzo-sending) for details.
91
+ *
92
+ * Please note that TZO is only available on certain plans.
93
+ * See www.mailgun.com/pricing for more info.
94
+ */
95
+ 'o:time-zone-localize'?: string;
96
+ /**
97
+ * Enables sending in test mode. Pass `yes` if needed. See [Sending in Test Mode](https://documentation.mailgun.com/en/latest/user_manual.html#manual-testmode)
98
+ */
99
+ 'o:testmode'?: boolean | 'yes' | 'no';
100
+ /**
101
+ * Toggles tracking on a per-message basis, see [Tracking Messages](https://documentation.mailgun.com/en/latest/user_manual.html#tracking-messages for details. Pass 'yes', 'no', 'true' or 'false'
102
+ */
103
+ 'o:tracking'?: boolean | 'yes' | 'no';
104
+ /**
105
+ * Toggles clicks tracking on a per-message basis.
106
+ * Has higher priority than domain-level setting.
107
+ * Pass `yes`, `no`, `true`, `false` or `htmlonly`.
108
+ */
109
+ 'o:tracking-clicks'?: boolean | 'yes' | 'no' | 'htmlonly';
110
+ /**
111
+ * Toggles opens tracking on a per-message basis.
112
+ * Has higher priority than domain-level setting.
113
+ * Pass 'yes' or 'no', 'true' or 'false'
114
+ */
115
+ 'o:tracking-opens'?: boolean | 'yes' | 'no';
116
+ /**
117
+ * If set to 'True' or 'yes' this requires the message only be sent over a TLS connection.
118
+ * If a TLS connection can not be established, Mailgun will not deliver the message.
119
+ *
120
+ * If set to 'False' or 'no', Mailgun will still try and upgrade the connection,
121
+ * but if Mailgun can not, the message will be delivered over a plaintext SMTP connection.
122
+ *
123
+ * The default is 'False'.
124
+ */
125
+ 'o:require-tls'?: boolean | 'yes' | 'no';
126
+ /**
127
+ * If set to `True` or `yes`, the certificate and hostname will not be verified
128
+ * when trying to establish a TLS connection
129
+ * and Mailgun will accept any certificate during delivery.
130
+ *
131
+ * If set to `False` or `no`, Mailgun will verify the certificate and hostname.
132
+ * If either one can not be verified, a TLS connection will not be established.
133
+ *
134
+ * The default is `False`.
135
+ */
136
+ 'o:skip-verification'?: boolean | 'yes' | 'no';
137
+ /**
138
+ * A valid JSON-encoded dictionary, where key is a plain recipient address and value is a dictionary with variables that can be referenced in the message body. See [Batch Sending](https://documentation.mailgun.com/en/latest/user_manual.html#batch-sending) for more information.
139
+ */
140
+ 'recipient-variables'?: string;
141
+ /**
142
+ * h:' prefix followed by an arbitrary value allows to append a custom MIME header
143
+ * to the message ('X-My-Header' in this case).
144
+ * For example, `h:Reply-To` to specify Reply-To address.
145
+ */
146
+ 'h:X-My-Header'?: string;
147
+ /**
148
+ * `v:` prefix followed by an arbitrary name allows to attach a custom JSON data to the message. See [Attaching Data to Messages](https://documentation.mailgun.com/en/latest/user_manual.html#manual-customdata) for more information.
149
+ */
150
+ 'v:my-var'?: string;
151
+ [key: string]: any;
152
+ };
153
+ export interface MessagesSendAPIResponse {
154
+ status: number;
155
+ body: {
156
+ id: string;
157
+ message: string;
158
+ };
159
+ }
160
+ export interface MessagesSendResult {
161
+ id?: string;
162
+ message?: string;
163
+ status: number;
164
+ details?: string;
165
+ }