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