node-expert-sender
Install
npm install expert-sender
Usage
var ExpertSender = ;var expertSender = url: 'https://api.esv2.com/' key: 'yourKey'; expertSender;
Methods
addUserToList(options)
Add subscriber to list
Parameters
options
may contain next properties:
email
- subscriber's email (required)listId
- id of list (required)id
- user id (if you want to change subscriber's email)firstName
- subscriber's first namelastName
- subscriber's last namename
- subscriber's full name (first name + last name)trackingCode
- id of source (form, web-site, etc.)vendor
- id/name of traffic typeip
- subscriber's IPproperties
- array of extra properties (see example below)
Example
expertSender;
getLists(options)
Parameters
options
contains:
seedLists
- boolean, iftrue
- test subscriber lists will be returned, defaults to false
Example
expertSender;
getUser(options)
Receive short, long, fully information about user or event history
Parameters
options
contains:
email
- subscriber's email (required)options
- one ofShort
,Long
,Full
,EventHistory
Example
expertSender;
createNewsletter(options)
Send email to specified recipients
Parameters
options
contains:
recipients
- object with lists for sending mailings. Must contain at least one ofseedLists
,subscriberLists
orsubscriberSegments
(required, see example below)content
- object with next propertiesfromName
- string displaying infrom
email field (required)fromEmail
- email displaying infrom
email field (required)subject
- subject of email (required)html
- html body (requiredhtml
orplain
)plain
- plain text body (requiredhtml
orplain
)replyToName
- string displaying inreply-to
email fieldreplyToEmail
- email displaying inreply-to
email fieldheader
- header template idfooter
- footer template id
Example
expertSender;
sendTransactional(options)
Send email to specified recipients
Parameters
options
contains:
transactionId
- integer, (required)receiver
- object, must contain at least one ofid
andemail
. May containlistId
. (required)returnGuid
- boolean. Default value isfalse
.snippets
- array of{name: 'snippetName', value: 'snippetValue'}
pairs.attachments
- array of{fileName: 'name', mimeType: 'type', content: 'base64-encoded string'}
tuples.
Example
expertSender;
Note
ExpertSender API documentation is here.