Gathering detailed insights and metrics for feathers-sendwithus
Gathering detailed insights and metrics for feathers-sendwithus
Gathering detailed insights and metrics for feathers-sendwithus
Gathering detailed insights and metrics for feathers-sendwithus
npm install feathers-sendwithus
Typescript
Module System
Node Version
NPM Version
61.7
Supply Chain
94.1
Quality
74.6
Maintenance
50
Vulnerability
79.4
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
GPL-3.0 License
1 Stars
19 Commits
1 Forks
2 Watchers
1 Branches
2 Contributors
Updated on Aug 08, 2022
Latest Version
0.1.0
Package Id
feathers-sendwithus@0.1.0
Size
47.84 kB
NPM Version
3.10.3
Node Version
6.3.1
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
Feathers service for sending mailers with sendwithus.
STATUS: Under development (used in production since 0.0.4)
npm install --save feathers-sendwithus
1const sendwithusService = require('feathers-sendwithus'); 2 3module.exports = function() { 4 const app = this; 5 const config = app.get('mailer').sendwithus; 6 app.use('/mailers', sendwithusService(config)); 7};
Data is just passed to the sendwithus
api except
template
which is mapped using the template mapper.
1app.service('/mailers').create({ 2 template: 'friendly-name', 3 sender: { address: 'bar@email.com' }, 4 recipient: { address: 'foo@email.com' }, 5});
Works with batches too:
1app.service('/mailers').create([{ 2 template: 'forgotten-password', 3 sender: { address: 'bar@email.com' }, 4 recipient: { address: 'foo@email.com' }, 5}, { 6 template: 'confirmation-email', 7 sender: { address: 'baz@email.com' }, 8 recipient: { address: 'foo@email.com' }, 9}]); 10 11This will use the [`sendwithus` batch api](https://www.sendwithus.com/docs/api#batch-api-requests). 12In batch mode (data is an array) the request will always succeed, and return the result of each request. 13 14## Configuration 15 16`apiKey` - Sendwithus api key (Required) 17 18`templateNameMapping` - Will map template names to IDs when doing api calls (default: `true`) 19 20`templateNameCacheExpiry` - Duration before templates are fetched again to be 21 mapped. *Set larger or smaller depending on how 22 often you create new templates or change template names 23 (default 1h (one hour)) 24 25`templateMapper` - Custom function which maps templates (default: the built in cached template mapper) 26 e.g. 27 28`batchChunkSize` - default: 10, for the batch api, how many sends to chunk together in a request. Sendwithus [recommend 10](https://www.sendwithus.com/docs/api#batch-api). 29 30## Custom template mapper 31 32`templateMapper` is responsible for mapping given template names (data.template) to template ids that sendwithus understands. 33We implement one that fetches all templates and caches it until `templateNameCacheExpiry` time passes. 34You can mix ids and names, it will just map the names it finds and leave the rest. 35 36If you want to do your own mapping, say if you want to hard code the template names and ids in a config 37to remove the need for fetching you could implement your own mapper: 38 39```javascript 40const myMap = { friendly: 'templateId' }; 41 42const service = sendwithusService({ 43 ... 44 // @param names {Array} Array of template names passed into service (one for single call, multiple for batch) 45 // @returns {Promise} Promise containing ONLY template ids 46 templateMapper: names => Promise.resolve(names.map(n => myMap[n] || n)), 47}); 48 49service.create({ 50template: 'friendly', 51... 52}) will send { template: 'templateId' };
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/19 approved changesets -- score normalized to 0
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
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
64 existing vulnerabilities detected
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