0.4.0 • Published 4 years ago
@pureprofile/access-node-sdk v0.4.0
Access node sdk
Install
yarn add @pureprofile/access-node-sdk
||npm install -s @pureprofile/access-node-sdk
Docs
https://github.com/pureprofile-warp/access-node-sdk/blob/master/docs/index.html
sendEmail ⇒ Promise.<Array.<{rcpt: String, message_id: String}>>
Note: Params inside [] are optional
Returns: Promise.<Array.<{rcpt: String, message_id: String}>> - The request promise which resolves with an object if the send was success or rejects if there was an error.
Param | Type | Default | Description |
---|---|---|---|
conf | Object | The config object | |
conf.endpoint | string | Email API endpoint url, can be also autoresolved from env variables | |
conf.accessKey | string | Your unique accessKey | |
conf.secret | string | Your secret | |
request | Object | The request object | |
request.template | string | The GUID of the template | |
request.html | string | The HTML of the template | |
request.to | Array.<{recipient: String, panel: String, type: ('email'|'user'|'accoh')}> | The emails or the GUIDs of the recipients. | |
request.from | string | The email address that should send the emails. | |
request.fromName | string | The name which should send the email. | |
request.type | 'trans' | 'market' | The type of the email. | |
request.replyTo | string | The email address that should receive the replies. | |
request.subject | string | The subject of the email. | |
request.vars | Object | Extra vars that you want to pass to the argument. | |
request.priority | number | The priority of the emails. | |
request.scheduled | string | An ISO timestamp if you want to schedule the email for a specific date. | |
request.addUnsubscribeLink | boolean | false | Include an unsubscribe link to the email. |
Example
sendEmail({
acessKey: "",
secret: ""
}, {
template: "cada42b4-6cca-4b44-9561-ff29e8dfdbd5",
to: [
{
"recipient": "005cf5c8-ad23-4750-b8a0-b1ecd5bc6ec8",
"panel": "81b84740-d250-4470-89f8-f3299d8e0e6e",
"type": "accoh"
},{
"recipient": "de4e1e8b-1fe9-4800-a815-ce940206815d",
"panel": "81b84740-d250-4470-89f8-f3299d8e0e6e",
"type": "user"
},{
"recipient": "chris.sylaios@gmail.com",
"panel": "81b84740-d250-4470-89f8-f3299d8e0e6e",
"type": "email"
}
],
from: "no-reply-dev@pureprofile.com",
fromName: "Pureprofile",
type: "trans",
replyTo: "info@pureprofile.com",
subject: "test subject"
});
0.4.0
4 years ago
0.3.9
5 years ago
0.3.8
5 years ago
0.3.7
5 years ago
0.3.6
5 years ago
0.3.5
5 years ago
0.3.4
5 years ago
0.3.3
5 years ago
0.3.2
5 years ago
0.3.1
5 years ago
0.3.0
5 years ago
0.2.1
6 years ago
0.2.0
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.13
6 years ago
0.0.12
6 years ago
0.0.11
6 years ago
0.0.10
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago