IO-3020 IO-3036 Initial removal of ProManager
This commit is contained in:
@@ -14,8 +14,7 @@ const { header, end, start } = require("./html");
|
||||
const defaultFooter = () => {
|
||||
return RenderInstanceManager({
|
||||
imex: "ImEX Online Collision Repair Management System",
|
||||
rome: "Rome Technologies",
|
||||
promanager: "ProManager"
|
||||
rome: "Rome Technologies"
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -53,8 +53,7 @@ const sendServerEmail = async ({ subject, text }) => {
|
||||
{
|
||||
from: InstanceManager({
|
||||
imex: `ImEX Online API - ${process.env.NODE_ENV} <noreply@imex.online>`,
|
||||
rome: `Rome Online API - ${process.env.NODE_ENV} <noreply@romeonline.io>`,
|
||||
promanager: `ProManager API - ${process.env.NODE_ENV} <noreply@promanager.web-est.com>`
|
||||
rome: `Rome Online API - ${process.env.NODE_ENV} <noreply@romeonline.io>`
|
||||
}),
|
||||
to: ["patrick@imexsystems.ca", "support@thinkimex.com"],
|
||||
subject: subject,
|
||||
@@ -78,27 +77,13 @@ const sendServerEmail = async ({ subject, text }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const sendProManagerWelcomeEmail = async ({ to, subject, html }) => {
|
||||
try {
|
||||
await mailer.sendMail({
|
||||
from: `ProManager <noreply@promanager.web-est.com>`,
|
||||
to,
|
||||
subject,
|
||||
html
|
||||
});
|
||||
} catch (error) {
|
||||
logger.log("server-email-failure", "error", null, null, { error });
|
||||
}
|
||||
};
|
||||
|
||||
const sendTaskEmail = async ({ to, subject, type = "text", html, text, attachments }) => {
|
||||
try {
|
||||
mailer.sendMail(
|
||||
{
|
||||
from: InstanceManager({
|
||||
imex: `ImEX Online <noreply@imex.online>`,
|
||||
rome: `Rome Online <noreply@romeonline.io>`,
|
||||
promanager: `ProManager <noreply@promanager.web-est.com>`
|
||||
rome: `Rome Online <noreply@romeonline.io>`
|
||||
}),
|
||||
to: to,
|
||||
subject: subject,
|
||||
@@ -247,8 +232,7 @@ const emailBounce = async (req, res) => {
|
||||
replyTo ===
|
||||
InstanceManager({
|
||||
imex: "noreply@imex.online",
|
||||
rome: "noreply@romeonline.io",
|
||||
promanager: "noreply@promanager.web-est.com"
|
||||
rome: "noreply@romeonline.io"
|
||||
})
|
||||
) {
|
||||
res.sendStatus(200);
|
||||
@@ -270,13 +254,11 @@ const emailBounce = async (req, res) => {
|
||||
//bcc: "patrick@snapt.ca",
|
||||
subject: `${InstanceMgr({
|
||||
imex: "ImEX Online",
|
||||
rome: "Rome Online",
|
||||
promanager: "ProManager"
|
||||
rome: "Rome Online"
|
||||
})} Bounced Email - RE: ${subject}`,
|
||||
text: `${InstanceMgr({
|
||||
imex: "ImEX Online",
|
||||
rome: "Rome Online",
|
||||
promanager: "ProManager"
|
||||
rome: "Rome Online"
|
||||
})} has tried to deliver an email with the subject: ${subject} to the intended recipients but encountered an error.
|
||||
|
||||
${body.bounce?.bouncedRecipients.map(
|
||||
@@ -305,6 +287,5 @@ module.exports = {
|
||||
sendEmail,
|
||||
sendServerEmail,
|
||||
sendTaskEmail,
|
||||
sendProManagerWelcomeEmail,
|
||||
emailBounce
|
||||
};
|
||||
|
||||
@@ -87,14 +87,7 @@ const formatPriority = (priority) => {
|
||||
const getEndpoints = (bodyshop) =>
|
||||
InstanceManager({
|
||||
imex: process.env?.NODE_ENV === "test" ? "https://test.imex.online" : "https://imex.online",
|
||||
rome:
|
||||
bodyshop?.convenient_company === "promanager"
|
||||
? process.env?.NODE_ENV === "test"
|
||||
? "https//test.promanager.web-est.com"
|
||||
: "https://promanager.web-est.com"
|
||||
: process.env?.NODE_ENV === "test"
|
||||
? "https//test.romeonline.io"
|
||||
: "https://romeonline.io"
|
||||
rome: process.env?.NODE_ENV === "test" ? "https//test.romeonline.io" : "https://romeonline.io"
|
||||
});
|
||||
|
||||
const generateTemplateArgs = (title, priority, description, dueDate, bodyshop, job, taskId, dateLine, createdBy) => {
|
||||
@@ -120,10 +113,7 @@ const generateTemplateArgs = (title, priority, description, dueDate, bodyshop, j
|
||||
const sendMail = (type, to, subject, html, taskIds, successCallback, requestInstance) => {
|
||||
const fromEmails = InstanceManager({
|
||||
imex: "ImEX Online <noreply@imex.online>",
|
||||
rome:
|
||||
requestInstance === "promanager"
|
||||
? "ProManager <noreply@promanager.web-est.com>"
|
||||
: "Rome Online <noreply@romeonline.io>"
|
||||
rome: "Rome Online <noreply@romeonline.io>"
|
||||
});
|
||||
|
||||
mailer.sendMail(
|
||||
@@ -239,10 +229,7 @@ const tasksRemindEmail = async (req, res) => {
|
||||
recipientCounts.forEach((recipient) => {
|
||||
const fromEmails = InstanceManager({
|
||||
imex: "ImEX Online <noreply@imex.online>",
|
||||
rome:
|
||||
tasksRequest?.tasks[0].bodyshop.convenient_company === "promanager"
|
||||
? "ProManager <noreply@promanager.web-est.com>"
|
||||
: "Rome Online <noreply@romeonline.io>"
|
||||
rome: "Rome Online <noreply@romeonline.io>"
|
||||
});
|
||||
|
||||
const emailData = {
|
||||
@@ -279,14 +266,7 @@ const tasksRemindEmail = async (req, res) => {
|
||||
else {
|
||||
const endPoints = InstanceManager({
|
||||
imex: process.env?.NODE_ENV === "test" ? "https://test.imex.online" : "https://imex.online",
|
||||
rome:
|
||||
tasksRequest?.tasks[0].bodyshop.convenient_company === "promanager"
|
||||
? process.env?.NODE_ENV === "test"
|
||||
? "https//test.promanager.web-est.com"
|
||||
: "https://promanager.web-est.com"
|
||||
: process.env?.NODE_ENV === "test"
|
||||
? "https//test.romeonline.io"
|
||||
: "https://romeonline.io"
|
||||
rome: process.env?.NODE_ENV === "test" ? "https//test.romeonline.io" : "https://romeonline.io"
|
||||
});
|
||||
|
||||
const allTasks = groupedTasks[recipient.email];
|
||||
|
||||
Reference in New Issue
Block a user