@enonic-types/lib-mail 8.0.0-B2 → 8.0.0-B5
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/mail.d.ts +11 -11
- package/package.json +2 -2
package/mail.d.ts
CHANGED
|
@@ -13,12 +13,12 @@ export interface Attachment {
|
|
|
13
13
|
}
|
|
14
14
|
export interface SendMessageParams {
|
|
15
15
|
subject: string;
|
|
16
|
-
from: string;
|
|
16
|
+
from: string | string[];
|
|
17
17
|
body: string;
|
|
18
18
|
to: string | string[];
|
|
19
19
|
cc?: string | string[];
|
|
20
20
|
bcc?: string | string[];
|
|
21
|
-
replyTo?: string;
|
|
21
|
+
replyTo?: string | string[];
|
|
22
22
|
contentType?: string;
|
|
23
23
|
headers?: Record<string, string>;
|
|
24
24
|
attachments?: Attachment[];
|
|
@@ -29,8 +29,8 @@ export interface SendMessageParams {
|
|
|
29
29
|
* The address values can be either a simple email address (e.g. ‘name@domain.org’ ) or an address with a
|
|
30
30
|
* display name. In the latter case the email will be enclosed with angle brackets (e.g. ‘Some Name <name@domain.org>’ ).
|
|
31
31
|
*
|
|
32
|
-
* The parameters `to`, `cc` and `
|
|
33
|
-
* to specify.
|
|
32
|
+
* The parameters `from`, `to`, `cc`, `bcc` and `replyTo` can be passed as a single string or as an array of strings, if there are
|
|
33
|
+
* multiple addresses to specify.
|
|
34
34
|
*
|
|
35
35
|
* The content-type of the email can be specified by using the `contentType` parameter. See example below for
|
|
36
36
|
* sending a message with an HTML body.
|
|
@@ -38,27 +38,27 @@ export interface SendMessageParams {
|
|
|
38
38
|
* @example-ref examples/mail/send.js
|
|
39
39
|
*
|
|
40
40
|
* @param {object} params JSON with the parameters.
|
|
41
|
-
* @param {string} params.from The email address, and optionally name of the sender of the message.
|
|
41
|
+
* @param {(string|string[])} params.from The email address(es), and optionally name(s) of the sender of the message.
|
|
42
42
|
* @param {(string|string[])} params.to The email address(es), and optionally name(s) of the primary message’s recipient(s).
|
|
43
43
|
* @param {(string|string[])} [params.cc] The carbon copy email address(es).
|
|
44
44
|
* @param {(string|string[])} [params.bcc] The blind carbon copy email address(es).
|
|
45
|
-
* @param {string} [params.replyTo] The email address that should be used to reply to the message.
|
|
45
|
+
* @param {(string|string[])} [params.replyTo] The email address(es) that should be used to reply to the message.
|
|
46
46
|
* @param {string} params.subject The subject line of the message.
|
|
47
47
|
* @param {string} params.body The text content of the message.
|
|
48
48
|
* @param {string} [params.contentType] Content type of the message body.
|
|
49
|
-
* @param {
|
|
49
|
+
* @param {Object<string, string>} [params.headers] Custom headers in the form of name-value pairs.
|
|
50
50
|
* @param {object[]} [params.attachments] Attachments to include in the email.
|
|
51
51
|
* @param {string} params.attachments.fileName Attachment file name.
|
|
52
|
-
* @param {
|
|
52
|
+
* @param {ByteSource} params.attachments.data Attachment stream.
|
|
53
53
|
* @param {string} [params.attachments.mimeType] Attachment content type. If not specified will be inferred from the file extension.
|
|
54
|
-
* @param {
|
|
54
|
+
* @param {Object<string, string>} [params.attachments.headers] Attachment headers, in the form of name-value pairs.
|
|
55
55
|
*
|
|
56
56
|
* @returns {boolean} True if the message was sent successfully, false otherwise.
|
|
57
57
|
*/
|
|
58
58
|
export declare function send(params: SendMessageParams): boolean;
|
|
59
59
|
/**
|
|
60
|
-
* This function returns
|
|
60
|
+
* This function returns the default from email address.
|
|
61
61
|
*
|
|
62
|
-
* @returns {string} The default from
|
|
62
|
+
* @returns {string|null} The default from email address, or null if not set.
|
|
63
63
|
*/
|
|
64
64
|
export declare function getDefaultFromEmail(): string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enonic-types/lib-mail",
|
|
3
|
-
"version": "8.0.0-
|
|
3
|
+
"version": "8.0.0-B5",
|
|
4
4
|
"description": "Type definitions for lib-mail.",
|
|
5
5
|
"types": "mail.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/enonic/xp/tree/master#readme",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@enonic-types/core": "8.0.0-
|
|
30
|
+
"@enonic-types/core": "8.0.0-B5"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|