Compare commits

..

No commits in common. "c1afc06e894762402534fe26948b59790bce2647" and "b80b6ec918a5aec4649c1bdd9e7f7ccef5918b41" have entirely different histories.

2 changed files with 20 additions and 17 deletions

View File

@ -43,10 +43,10 @@ app.post('/print-temp-pw', async (req, res) => {
} }
// Generate the information string // Generate the information string
const infoArray = Thermal.generateInfo.tempPassword(password); const infoString = Thermal.generateInfo.tempPassword(password);
// Generate the PDF, saved to disk // Generate the PDF, saved to disk
Thermal.generatePdf(infoArray).catch(e => { Thermal.generatePdf(infoString).catch(e => {
console.error(e); console.error(e);
res.status(500).json({ message: 'Error writing PDF file', error: err.message }); res.status(500).json({ message: 'Error writing PDF file', error: err.message });
}); });
@ -60,10 +60,10 @@ app.post('/print-temp-pw', async (req, res) => {
app.post('/print-mcc', async (req, res) => { app.post('/print-mcc', async (req, res) => {
try { try {
// Generate the information string // Generate the information string
const infoArray = Thermal.generateInfo.maineCC(); const infoString = Thermal.generateInfo.maineCC();
// Generate the PDF, saved to disk // Generate the PDF, saved to disk
Thermal.generatePdf(infoArray).catch(e => { Thermal.generatePdf(infoString).catch(e => {
console.error(e); console.error(e);
res.status(500).json({ message: 'Error writing PDF file', error: e.message }); res.status(500).json({ message: 'Error writing PDF file', error: e.message });
}); });

View File

@ -34,23 +34,26 @@ module.exports = {
}, },
maineCC() { maineCC() {
// Create the output text // Create the output text
return [ const infoArray = [
{ font: 'public/Outfit-Regular.ttf', text: 'Kennebec Valley Community College is migrating email domains from @kvcc.me.edu to @mainecc.edu.\n' }, 'Kennebec Valley Community College is migrating email domains from @kvcc.me.edu to @mainecc.edu.\n',
{ font: 'public/Outfit-Regular.ttf', text: `For support with this transition, please contact:` } `For support with this transition, please contact:\n${mccContractor.name}`,
{ font: 'public/RobotoMono-SemiBold.ttf', text: `${mccContractor.name}` }, `${mccContractor.phone}`,
{ font: 'public/RobotoMono-SemiBold.ttf', text: `${mccContractor.phone}` }, `${mccContractor.email}`,
{ font: 'public/RobotoMono-SemiBold.ttf', text: `${mccContractor.email}` }, `${mccContractor.site}\n`,
{ font: 'public/RobotoMono-SemiBold.ttf', text: `${mccContractor.site}\n` } receiptFooter
]; ];
return infoArray.join('\n');
}, },
tempPassword(password) { tempPassword(password) {
// Create the output text // Create the output text
return [ const infoArray = [
{ font: 'public/Outfit-Regular.ttf', text: 'We have changed your password to a temporary password, shown below. Next time you log into Microsoft you will be prompted to change your password.\n' }, 'We have changed your password to a temporary password, shown below. Next time you log into Microsoft you will be prompted to change your password.\n',
{ font: 'public/Outfit-Regular.ttf', text: 'Temporary Password:' }, 'Temporary Password:',
{ font: 'public/RobotoMono-SemiBold.ttf', text: `${password}\n` }, `${password}\n`,
{ font: 'public/Outfit-Regular.ttf', text: 'Password requirements:\n8+ characters\n1+ Uppercase\n1+ Lowercase\n1+ Special (!/_=.,?)\n' } 'Password requirements:\n8+ characters\n1+ Uppercase\n1+ Lowercase\n1+ Special (!/_=.,?)\n',
] receiptFooter
];
return infoArray.join('\n');
} }
}, },
generatePdf(infoArray) { generatePdf(infoArray) {