28 lines
623 B
JavaScript
28 lines
623 B
JavaScript
import { consoleLogger } from "../core/logger";
|
|
import { requestJson } from "../clients/endpointClient";
|
|
|
|
export const sendEmail = async (
|
|
templateId,
|
|
emailAddress,
|
|
personalisation,
|
|
reference
|
|
) => {
|
|
var mailData = {
|
|
"templateId": templateId,
|
|
"emailAddress": emailAddress,
|
|
"reference": reference,
|
|
"personalisation": personalisation
|
|
};
|
|
|
|
try {
|
|
return await requestJson({
|
|
method: "post",
|
|
url: "/api/email/notify",
|
|
data: mailData
|
|
});
|
|
} catch (error) {
|
|
consoleLogger(error);
|
|
throw error;
|
|
}
|
|
};
|