IO-2973 Created By Tasks
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
@@ -77,6 +77,7 @@ const formatPriority = (priority) => {
|
||||
* @param priority
|
||||
* @param description
|
||||
* @param dueDate
|
||||
* @param createdBy
|
||||
* @param bodyshop
|
||||
* @param job
|
||||
* @param taskId
|
||||
@@ -96,11 +97,11 @@ const getEndpoints = (bodyshop) =>
|
||||
: "https://romeonline.io"
|
||||
});
|
||||
|
||||
const generateTemplateArgs = (title, priority, description, dueDate, bodyshop, job, taskId, dateLine) => {
|
||||
const generateTemplateArgs = (title, priority, description, dueDate, createdBy, bodyshop, job, taskId, dateLine) => {
|
||||
const endPoints = getEndpoints(bodyshop);
|
||||
return {
|
||||
header: title,
|
||||
subHeader: `Body Shop: ${bodyshop.shopname} | Priority: ${formatPriority(priority)} ${formatDate(dueDate)}`,
|
||||
subHeader: `Body Shop: ${bodyshop.shopname} | Priority: ${formatPriority(priority)} | Due on: ${formatDate(dueDate)} | Created by: ${createdBy || "N/A"}`,
|
||||
body: `Reference: ${job.ro_number || "N/A"} | ${job.ownr_co_nm ? job.ownr_co_nm : `${job.ownr_fn || ""} ${job.ownr_ln || ""}`.trim()} | ${`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${job.v_model_desc || ""}`.trim()}<br>${description ? description.concat("<br>") : ""}<a href="${endPoints}/manage/tasks/alltasks?taskid=${taskId}">View this task.</a>`,
|
||||
dateLine
|
||||
};
|
||||
@@ -178,6 +179,7 @@ const taskAssignedEmail = async (req, res) => {
|
||||
newTask.priority,
|
||||
newTask.description,
|
||||
newTask.due_date,
|
||||
newTask.created_by,
|
||||
tasks_by_pk.bodyshop,
|
||||
tasks_by_pk.job,
|
||||
newTask.id,
|
||||
@@ -265,6 +267,7 @@ const tasksRemindEmail = async (req, res) => {
|
||||
onlyTask.priority,
|
||||
onlyTask.description,
|
||||
onlyTask.due_date,
|
||||
onlyTask.created_by,
|
||||
onlyTask.bodyshop,
|
||||
onlyTask.job,
|
||||
onlyTask.id,
|
||||
|
||||
Reference in New Issue
Block a user