refactor(actions): phase 5 extract remaining direct service modules
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import axios from "axios";
|
||||
import { consoleLogger } from "../core/logger";
|
||||
|
||||
export const sendEmail = async (
|
||||
templateId,
|
||||
emailAddress,
|
||||
personalisation,
|
||||
reference
|
||||
) => {
|
||||
var mailData = {
|
||||
"templateId": templateId,
|
||||
"emailAddress": emailAddress,
|
||||
"reference": reference,
|
||||
"personalisation": personalisation
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await axios.post("/api/email/notify", mailData);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user