oute-services-mail-sdk
v0.0.3
Published
- Initialization
Downloads
36
Readme
This module expose helper functions
- Initialization
params = {
url: @server url
token: @access token
}
Mail = require("oute-services-mail-sdk")
mail_instance = new Mail(params)
Cache functions
Core functions
- Save
body = {
"asset_id": "q-GmTD5-K",
"workspace_id": "ZzBfJMpfQ",
"json": {
"a": "test"
},
"html": "<html><body>hhhh</body></html>",
"name" : "email template",
"project_id" : "zZ3Fgzk1T",
"type" : "FILE",
"annotation" : "EMAIL_TEMPLATE",
"user_id" : "[email protected]",
"share_to_all": true
}
await mail_instance.save(body)
- Find One
query = {
"_id": "UvuPE2PGn"
}
await mail_instance.findOne(query)
- get by project id
query = {
"project_id": "zZ3Fgzk1T"
}
await mail_instance.getByProjectId(query)