Installations
npm install email-templates-approve
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
16.15.0
NPM Version
8.5.5
Score
64.1
Supply Chain
94.2
Quality
78.5
Maintenance
25
Vulnerability
97.9
License
Releases
Unable to fetch releases
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Download Statistics
Total Downloads
50,016
Last Day
2
Last Week
12
Last Month
253
Last Year
3,932
Package Meta Information
Latest Version
3.2.54
Package Id
email-templates-approve@3.2.54
Unpacked Size
1.13 MB
Size
67.39 kB
File Count
45
NPM Version
8.5.5
Node Version
16.15.0
Published on
Feb 05, 2024
Total Downloads
Cumulative downloads
Total Downloads
50,016
Last Day
0%
2
Compared to previous day
Last Week
0%
12
Compared to previous week
Last Month
-66.9%
253
Compared to previous month
Last Year
-67.4%
3,932
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Email Templates
This library is responsible for creating email templates
Installation
Use npm to install the package
1npm install email-templates-approve
Usage
Basic example
1import emailTemplates from "email-templates-approve/src/index"; 2 3const html = emailTemplates.generalNotification(data, lang);
Adding New Template
From the root directory, using the CLI you can run the following command
1node new-template-script <templateName>
This command will generate the most of the boilerplate needed for the new template.
The console will print which files has been added to the project.
IMPORTANT! - Inside the main file (/src/index.js) a new function will be created by the CLI command. You need to add this function to the emailTemplates
object which exported from this file. This is the only boilerplate action that needed to be done manually.
Anyway, the console will tell you to do so after running the new-template-script
command.
Template Debugging
Run npm start
and an express server will be lunched.
In the browser, navigate into localhost:5020/?templateName=<templateName>
, replace the query variable with the desired template name (camel case, like how the template files names written).
To change the template data payload, just go to /src/constants/testingPayloads.constant.js
and change the relevant object.
Publish
In order to publish your changes run the following command from anywhere inside the project.
You should be member of the NPM repository package to be abele to do so.
1npm version patch 2npm publish
No need to increase the package version manually, its done by the prepublish
npm script.
Interface
All the exposed functions accepts two arguments - data: any
and lang: 'en' | 'he' (default 'en')
.
The type of data
depends on the function we use:
- singleContractExpirationNotification
1data: { 2 logo: string, 3 name: string, 4 vendorName: string, 5 daysToExpire: string | number, 6 expirationDate: string, 7 actionUrl: string 8}
- multiContractExpirationNotification
1data: { 2 logo: string, 3 name: string, 4 contracts: { 5 vendorName: string, 6 daysToExpire: string | number, 7 expirationDate: string 8 }[], 9 actionUrl: string 10}
- userInvite
1data: { 2 addresseeName: string, 3 inviterName: string, 4 buttonUrl: string 5}
- userInviteWithCredentials
1data: { 2 addresseeName: string, 3 inviterName: string, 4 companyName: string, 5 username: string, 6 code: string, 7 buttonUrl: string, 8}
- goodsReceived
1data: { 2 items: {title: string, quantity: string | number}, 3 buttonUrl: string, 4 linkUrl: string 5}
- purchaseAssign
1data: { 2 addresseeName: string, 3 title: string, 4 approvalFlow?: string, 5 description?: string, 6 isRequestedForHidden?: boolean, 7 requestedForName?: string, 8 requestedForTitle?: string, 9 requestorName: string, 10 requestorTitle?: string, 11 swId?: string, 12 vendorName?: string, 13 vendorErpId?: string, 14 budgetItem?: string, 15 department?: string[], 16 usdAmount: string | number, 17 items?: { 18 description: string, 19 quantity: number, 20 amount: number, 21 currency: string, 22 timeFrame?: { 23 from: Date, 24 to: Date 25 } 26 }[], 27 approveUrl?: string, 28 rejectUrl?: string, 29 purchaseUrl: string, 30 isCC?: boolean, 31}
- purchaseApprove
1data: { 2 addresseeName: string, 3 buttonUrl: string, 4 purchaseTitle: string, 5 approverName: string, 6 approverTitle: string, 7 note?: string 8 isCC?: boolean, 9}
- purchaseApproveWithPo
1data: { 2 addresseeName: string, 3 buttonUrl: string, 4 purchaseTitle: string, 5 approverName: string, 6 approverTitle?: string, 7 poNumber: string, 8 note?: string 9 isCC?: boolean, 10}
- purchaseReject
1data: { 2 addresseeName: string, 3 buttonUrl: string, 4 purchaseTitle: string, 5 approverName: string, 6 approverTitle?: string, 7 note?: string 8 isCC?: boolean, 9}
- purchaseReturn
1data: { 2 addresseeName: string, 3 title: string, 4 approverName: string, 5 approverTitle?: string, 6 note?: string, 7 buttonUrl: string 8}
- purchaseDelegateForward
1data: { 2 addresseeName: string, 3 approverName: string, 4 approverTitle?: string, 5 title: string, 6 note?: string, 7 approvalFlow?: string, 8 description: string, 9 isRequestedForHidden?: boolean, 10 requestedForName?: string, 11 requestedForTitle?: string, 12 requestorName: string, 13 requestorTitle?: string, 14 swId?: string, 15 vendorName?: string, 16 vendorErpId?: string, 17 budgetItem?: string, 18 department?: string[], 19 usdAmount: string | number, 20 items: { 21 description: string, 22 quantity: number, 23 amount: number, 24 currency: string, 25 timeFrame?: { 26 from: Date, 27 to: Date 28 } 29 }[], 30 replyUrl?: string, 31 purchaseUrl: string, 32 isCC?: boolean, 33}
- purchaseDelegateBackward
1data: { 2 title: string, 3 addresseeName: string, 4 approverName: string, 5 approverNodeName: string, 6 note?: string 7 buttonUrl: string 8}
- vendorApprove
1data: { 2 companyName: string, 3 vendorName: string,, 4 isCC?: boolean, 5}
- vendorApproveForVendor
1data: { 2 vendorLogoUrl: string, 3 companyName: string, 4 isCC?: boolean, 5}
- vendorReject
1data: { 2 logoUrl: string, 3 addresseeName: string, 4 buttonUrl: string, 5 vendorName: string, 6 approverName: string, 7 approverTitle?: string, 8 isCC?: boolean, 9}
- vendorRejectForVendor
1data: { 2 logoUrl: string, 3 companyName: string, 4 approverName: string, 5 note?: string, 6 isCC?: boolean, 7}
- vendorReturnForVendor
1data: { 2 logoUrl: string, 3 vendorName: string, 4 approverName: string, 5 companyName: string, 6 buttonUrl: string, 7 note?: string, 8 isCC?: boolean, 9}
- vendorInvite
1data: { 2 logoUrl: string, 3 inviterName: string, 4 companyName: string, 5 invitationNote?: string 6 buttonUrl: string, 7 isCC?: boolean, 8}
- vendorAssign
1data: { 2 logoUrl: string, 3 addresseeName: string, 4 vendorName: string, 5 vendorDescription: string, 6 vendorOwnerName: string, 7 goToVendorUrl: string 8}
- vendorDelegateForward
1data: { 2 logoUrl: string, 3 addresseeName: string, 4 addressedName: string, 5 vendorName: string, 6 vendorDescription?: string, 7 vendorOwnerName: string, 8 vendorOwnerEmail: string, 9 buttonUrl: string, 10 enterApproveUrl: string, 11}
- vendorReturn
1data: { 2 logoUrl: string, 3 addresseeName: string, 4 approverName: string, 5 vendorName: string, 6 note?: string, 7 buttonUrl: string, 8}
- contractrsExpirationReminder
1data: { 2 addresseeName: string, 3 contracts: { 4 vendorName: string, 5 daysToExpire: string, 6 expirationDate: string, 7 }[], 8 actionUrl: string, 9}
- goodsReceivedReminder
1data: { 2 addresseeName: string, 3 items: { 4 description: string, 5 quantity: number | string, 6 }[], 7 buttonUrl: string, 8}
- purchasesActionReminder
1data: { 2 addresseeName: string, 3 purchases: { 4 title: string, 5 url: string 6 }[], 7 daysCount: number | string, 8 buttonUrl: string, 9}
- contractApprove
1data: { 2 title: string, 3 approverName: string, 4 approverTitle: string, 5 note: string, 6 contractUrl: string, 7}
- contractAssign
1data: { 2 title: string, 3 description: string, 4 vendorName: string, 5 datesRange: '01/01/2021 - 31/12/20201', 6 contractTerm: string, 7 contractUrl: string, 8 contractsUrl: string, 9}
- contractDelegateBackward
1data: { 2 addresseeName: string, 3 addresserName: string, 4 title: string, 5 note: string, 6 contractUrl: string, 7}
- contractDelegateForward
1data: { 2 addresseeName: string 3 addresserName: string, 4 title: string, 5 description: string, 6 vendorName: string, 7 datesRange: '01/01/20201 - 31/12/2021', 8 contractTerm: string, 9 replyUrl: string, 10 approveUrl: string, 11}
- contractReject
1data: { 2 title: string, 3 addresserName: string, 4 addresserTitle: string, 5 note: string, 6 contractUrl: string, 7}
- contractReturn
1data: { 2 addresseeName: string, 3 title: string, 4 addresserName: string, 5 addresserTitle: string, 6 note: string, 7 contractUrl: string, 8}
- forgotPassword
1data: { 2 addresseeName: string, 3 code: string, 4}
- vendor-register-externally
1data: { 2 contactName: string, 3 requestorName: string, 4 description: string, 5 swId: string, 6 purchaseUrl: string, 7 vendorName: string 8}

No vulnerabilities found.

No security vulnerabilities found.