sendemail function for gov notify
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { consoleLogger } from "../../../actions";
|
||||
|
||||
export default async function ApiProxy(req, res) {
|
||||
var data = req.body;
|
||||
|
||||
var NotifyClient = require("notifications-node-client").NotifyClient;
|
||||
|
||||
const notifyClient = new NotifyClient(process.env.NOTIFY_API_KEY);
|
||||
//const emailReplyToId = process.env.EMAIL_REPLY_TO_ID;
|
||||
|
||||
notifyClient
|
||||
.sendEmail(data.templateId, data.emailAddress, {
|
||||
personalisation: data.personalisation,
|
||||
reference: data.reference,
|
||||
// emailReplyToId: emailReplyToId,
|
||||
})
|
||||
.then((response) => {
|
||||
//console.log("thisis the response", response);
|
||||
return res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
consoleLogger(err);
|
||||
return res.status(400).json(err);
|
||||
});
|
||||
//return res.status(200).json(data);
|
||||
}
|
||||
@@ -32,7 +32,8 @@ ApiProxy.get(async (req, res) => {
|
||||
|
||||
res.setHeader(
|
||||
"content-disposition",
|
||||
"attachment; filename=" + decodeURI(blobName)
|
||||
"attachment; filename=" +
|
||||
decodeURI(blobName.slice(blobName.indexOf("_") + 1))
|
||||
);
|
||||
return res.status(200).send(downloaded);
|
||||
} else {
|
||||
|
||||
@@ -26,6 +26,7 @@ ApiProxy.get(async (req, res) => {
|
||||
//if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
||||
const blobObj = await getProgressBlobs(containerName, casefolderID)
|
||||
.then((data) => {
|
||||
console.log("ertyuikjhgfg", data.path);
|
||||
return downloadProgressFile(containerName, data.path, casefolderID);
|
||||
})
|
||||
.then((data) => {
|
||||
|
||||
Reference in New Issue
Block a user