Gathering detailed insights and metrics for sendwithus
Gathering detailed insights and metrics for sendwithus
Gathering detailed insights and metrics for sendwithus
Gathering detailed insights and metrics for sendwithus
grunt-sendwithus
Grunt plugin to deploy your local HTML email templates to sendwithus
feathers-sendwithus
Feathers service for sending mailers with sendwithus.com.
feathers-sendwithus-batch
Feathers service for sending mailers with sendwithus.com.
sendwithus.node
Sendwithus API client for node.js
npm install sendwithus
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
22 Stars
169 Commits
17 Forks
22 Watchers
3 Branches
34 Contributors
Updated on Jan 13, 2025
Latest Version
6.0.3
Package Id
sendwithus@6.0.3
Unpacked Size
110.72 kB
Size
26.37 kB
File Count
12
NPM Version
9.6.7
Node Version
18.17.1
Published on
Jan 13, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
1
npm install sendwithus
All callbacks accept err
and response
:
1const callback = function(err, response) { 2 if (err) { 3 console.log({message: err.message, status: response.status, statusText: response.statusText}); 4 } else { 5 console.log(response); 6 } 7};
1var api = require('sendwithus')('API_KEY'); 2api.templates(callback);
1var api = require('sendwithus')('API_KEY'); 2var data = { name: 'name', subject: 'subject', html: '<html><head></head><body></body></html>', text: 'some text' }; 3api.createTemplate(data, callback);
1var api = require('sendwithus')('API_KEY'); 2var data = { name: 'name', subject: 'subject', html: '<html><head></head><body></body></html>', text: 'some text' }; 3api.createTemplateVersion(TEMPLATE_ID, data, callback);
NOTE - If a customer does not exist by the specified email (recipient address), the send call will create a customer.
The template_data
field is optional, but highly recommended!
1var api = require('sendwithus')('API_KEY'); 2api.send({ 3 template: 'TEMPLATE_ID', 4 recipient: { address: 'us@sendwithus.com' } 5}, callback);
1var api = require('sendwithus')('API_KEY'); 2api.send({ 3 template: 'TEMPLATE_ID', 4 recipient: { 5 address: 'us@sendwithus.com', // required 6 name: 'Matt and Brad' 7 }, 8 template_data: { first_name: 'Matt' } 9}, callback);
sender['address']
is a required sender field
1var api = require('sendwithus')('API_KEY'); 2api.send({ 3 template: 'TEMPLATE_ID', 4 recipient: { address: 'us@sendwithus.com' }, 5 template_data: { first_name: 'Matt' }, 6 sender: { 7 address: 'company@company.com', // required 8 name: 'Company' 9 } 10}, callback);
sender['name']
and sender['reply_to']
are both optional
1var api = require('sendwithus')('API_KEY'); 2api.send({ 3 template: 'TEMPLATE_ID', 4 recipient: { address: 'us@sendwithus.com' }, 5 template_data: { first_name: 'Matt' }, 6 sender: { 7 address: 'company@company.com', // required 8 name: 'Company', 9 reply_to: 'info@company.com' 10 } 11}, callback);
1var api = require('sendwithus')('API_KEY'); 2api.send({ 3 template: TEMPLATE_ID, 4 recipient: { address: 'us@sendwithus.com' }, 5 bcc: [{ address: 'bcc@sendwithus.com' }], 6 cc: [ 7 { address: 'cc1@sendwithus.com' }, 8 { address: 'cc2@sendwithus.com' } 9 ] 10}, callback);
1var api = require('sendwithus')('API_KEY'); 2api.send({ 3 template: TEMPLATE_ID, 4 recipient: { address: 'us@sendwithus.com' }, 5 headers:{ 'X-HEADER-ONE': 'header-value' } 6}, callback);
1var api = require('sendwithus')('API_KEY'); 2api.send({ 3 template: TEMPLATE_ID, 4 recipient: { address: 'us@sendwithus.com' }, 5 esp_account:'esp_1234asdf1234' 6}, callback);
1var api = require('sendwithus')('API_KEY'); 2api.send({ 3 template: TEMPLATE_ID, 4 recipient: { address: 'us@sendwithus.com' }, 5 locale:'en-US' 6}, callback);
1var api = require('sendwithus')('API_KEY'); 2api.send({ 3 template: TEMPLATE_ID, 4 recipient: { address: 'us@sendwithus.com' }, 5 version_name:'Version A' 6}, callback);
1var api = require('sendwithus')('API_KEY'); 2api.customersUpdateOrCreate({ 3 email: 'foo@bar.com', 4 locale: 'fr-CA' 5}, callback);
1var api = require('sendwithus')('API_KEY'); 2api.customersDelete('foo@bar.com', callback);
1var api = require('sendwithus')('API_KEY'); 2api.dripCampaignList(callback);
1var api = require('sendwithus')('API_KEY'); 2api.dripCampaignDetails('DRIP_CAMPAIGN_ID', callback);
1var api = require('sendwithus')('API_KEY'); 2var data = { 3 recipient: { 4 address: 'RECIPIENT_ADDRESS', 5 name: 'RECIPIENT_NAME' 6 }, 7 email_data: { 8 country: 'Latveria' 9 } 10} 11api.dripCampaignActivate('DRIP_CAMPAIGN_ID', data, callback);
1var api = require('sendwithus')('API_KEY'); 2var data = { recipient_address: 'RECIPIENT_ADDRESS' }; 3api.dripCampaignDeactivate('DRIP_CAMPAIGN_ID', data, callback);
1var api = require('sendwithus')('API_KEY'); 2var data = { recipient_address: 'RECIPIENT_ADDRESS' }; 3api.dripCampaignDeactivateAll(data, callback);
1 > response.status; 2 OK 3 4 > response.success; 5 True 6 7 > response.receipt_id; 8 'numeric-receipt-id' 9
1 > err.statusCode; 2 400
1 > err.statusCode; 2 403
1var api = require('sendwithus')('API_KEY'); 2api.render({ template: 'SAMPLE_TEMPLATE_ID', template_data: { name: 'Bob' }, strict: true }, callback);
1var api = require('sendwithus')('API_KEY'); 2api.render({ 3 template: 'SAMPLE_TEMPLATE_ID', 4 template_data: { name: 'Bob' }, 5 locale: 'en-US', 6 strict: true 7}, callback);
1var api = require('sendwithus')('API_KEY'); 2api.render({ 3 template: 'SAMPLE_TEMPLATE_ID', 4 template_data: { name: 'Bob' }, 5 version_id: 'SAMPLE_VERSION_ID', 6 strict: true 7}, callback);
1{ 2 "success": true, 3 "status": "OK", 4 "template": { 5 "id": "ver_r4nd0ml3tt3rsv15h4l0l", 6 "name": "Template name", 7 "version_name": "Template version name", 8 "locale": "en-US" 9 }, 10 "subject": "RENDERED SUBJECT WITH DATA", 11 "html": "RENDERED HTML BODY WITH DATA", 12 "text": "RENDERED TEXT BODY WITH DATA" 13}
1var api = require('sendwithus')('API_KEY'); 2api.resend({"log_id": "log_asdf123456qwerty"}, callback);
1var api = require('sendwithus')('API_KEY'); 2api.batch([{ 3 "path": "/api/v1/send", 4 "method": "POST", 5 "body": { 6 "template": "TEMPLATE_ID", 7 "recipient": { 8 "address": "test+1@mydomain.com" 9 } 10 } 11}, { 12 "path": "/api/v1/send", 13 "method": "POST", 14 "body": { 15 "template": "TEMPLATE_ID", 16 "recipient": { 17 "address": "test+2@mydomain.com" 18 } 19 } 20}], callback);
request: function(method, url, headers, body)
- emitted when a request has been sent to Sendwithusresponse: function(statusCode, body, response)
- emitted when a response has been received back from SendwithusInstall requirements
npm install
Run Unit Tests
npm test
Debug mode prints out the underlying request information as well as the data payload that gets sent to Sendwithus. You will most likely find this information in your logs. To enable it, simply put debug=true
as a parameter when instantiating the API object. Use the debug mode to compare the data payload getting sent to Sendwithus' API docs.
1var api = require('sendwithus')('API_KEY', debug=true);
Sendwithus' API typically sends responses back in these ranges:
If you're receiving an error in the 400 response range follow these steps:
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 6/9 approved changesets -- score normalized to 6
Reason
SAST tool is not run on all commits -- score normalized to 1
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More