sendemail function for gov notify
This commit is contained in:
@@ -328,6 +328,10 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
||||
const tags = {
|
||||
containerid: containerName,
|
||||
caseID: foldername,
|
||||
documentType: files[prop][0].fieldName.slice(
|
||||
0,
|
||||
files[prop][0].fieldName.indexOf("_")
|
||||
),
|
||||
};
|
||||
const withTags = await blockBlobClient.setTags(tags);
|
||||
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||
@@ -362,10 +366,13 @@ export const downloadProgressFile = async (
|
||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||
const containerClient = new ContainerClient(sasUrl);
|
||||
const blobClient = containerClient.getBlobClient(blobName);
|
||||
const downloadedBlob = await blobClient.download(0);
|
||||
const downloadedBlob = await blobClient.download();
|
||||
|
||||
const downloaded = await streamToBuffer(downloadedBlob.readableStreamBody);
|
||||
return downloaded;
|
||||
|
||||
console.log("Downloaded blob content:", downloaded.toString());
|
||||
|
||||
return JSON.parse(downloaded.toString());
|
||||
};
|
||||
|
||||
export const downloadAllProgressFiles = async (
|
||||
|
||||
+9
-9
@@ -1371,19 +1371,19 @@ export const getProgressFromBlob = async (containerName, casereference) => {
|
||||
};
|
||||
|
||||
export const sendEmail = async (
|
||||
emailToAddress,
|
||||
emailSubject,
|
||||
emailContentTitle,
|
||||
emailContent
|
||||
templateId,
|
||||
emailAddress,
|
||||
personalisation,
|
||||
reference
|
||||
) => {
|
||||
var mailData = {
|
||||
"email": emailToAddress,
|
||||
"subject": emailSubject,
|
||||
"emailcontenttitle": emailContentTitle,
|
||||
"emailcontent": emailContent,
|
||||
"templateId": templateId,
|
||||
"emailAddress": emailAddress,
|
||||
"reference": reference,
|
||||
"personalisation": personalisation,
|
||||
};
|
||||
|
||||
var queryUrl = "/api/email";
|
||||
var queryUrl = "/api/email/notify";
|
||||
|
||||
var config = {
|
||||
method: "post",
|
||||
|
||||
Reference in New Issue
Block a user