placementt-core 11.0.892 → 11.0.951
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constants.d.ts +1 -0
- package/lib/constants.js +47 -1
- package/lib/constants.js.map +1 -1
- package/lib/hooks.d.ts +57 -15
- package/lib/hooks.js +217 -43
- package/lib/hooks.js.map +1 -1
- package/lib/typeDefinitions.d.ts +91 -4
- package/lib/util.d.ts +25 -1
- package/lib/util.js +329 -2
- package/lib/util.js.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +49 -0
- package/src/hooks.tsx +247 -47
- package/src/typeDefinitions.ts +96 -20
- package/src/util.ts +350 -4
package/lib/typeDefinitions.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DocumentData, DocumentReference, Timestamp } from "firebase/firestore";
|
|
2
2
|
import { Descendant } from "slate";
|
|
3
3
|
import { emailTemplates } from "./constants";
|
|
4
|
+
import { FilterObject } from "./hooks";
|
|
4
5
|
export type Products = "institutes" | "providers" | "students" | "admin";
|
|
5
6
|
export type StudentPlacementData = {
|
|
6
7
|
title: string;
|
|
@@ -19,6 +20,7 @@ export type StudentPlacementData = {
|
|
|
19
20
|
providerEmailed: Timestamp;
|
|
20
21
|
parentEmailed: Timestamp;
|
|
21
22
|
providerPhone: string;
|
|
23
|
+
studentDescription?: string;
|
|
22
24
|
website?: string;
|
|
23
25
|
id: string;
|
|
24
26
|
providerCompleted: string[];
|
|
@@ -155,6 +157,17 @@ export type PlacementQuestions = {
|
|
|
155
157
|
pay?: number;
|
|
156
158
|
payFrequency: "total" | "hourly" | "daily" | "weekly" | "monthly" | "annually";
|
|
157
159
|
};
|
|
160
|
+
export type SavedPlacement = {
|
|
161
|
+
placementId: string;
|
|
162
|
+
savedByProduct: Products;
|
|
163
|
+
savedByUserType: "Organisation" | "Student";
|
|
164
|
+
savedById: string;
|
|
165
|
+
schoolId?: string;
|
|
166
|
+
status?: "Accepted" | "Blocked" | "providerReview";
|
|
167
|
+
listed: boolean;
|
|
168
|
+
concurrentPlacements?: number;
|
|
169
|
+
id: string;
|
|
170
|
+
};
|
|
158
171
|
export type PlacementListing = {
|
|
159
172
|
title: string;
|
|
160
173
|
providerId: string;
|
|
@@ -343,6 +356,20 @@ export type UserData = {
|
|
|
343
356
|
};
|
|
344
357
|
};
|
|
345
358
|
alumniConversationUid?: string;
|
|
359
|
+
savedDataViewerFilters?: {
|
|
360
|
+
[cohortId: string]: {
|
|
361
|
+
[key in "cohortPlacements" | "cohortStudents"]: {
|
|
362
|
+
[viewKey: string]: DataViewerFilterView;
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
export type DataViewerFilterView = {
|
|
368
|
+
title: string;
|
|
369
|
+
search?: string;
|
|
370
|
+
sort?: string;
|
|
371
|
+
filters?: FilterObject;
|
|
372
|
+
permanent?: boolean;
|
|
346
373
|
};
|
|
347
374
|
export type AnalyticsItem = {
|
|
348
375
|
units?: "placements" | "weeks" | "days" | "hours";
|
|
@@ -560,7 +587,7 @@ export type ProviderContactData = {
|
|
|
560
587
|
savedBy?: {
|
|
561
588
|
[key: string]: {
|
|
562
589
|
exists: true;
|
|
563
|
-
activities?: string[];
|
|
590
|
+
activities?: null | string[];
|
|
564
591
|
providerConsent?: boolean;
|
|
565
592
|
providerConsentDate?: string;
|
|
566
593
|
MATschools?: string[];
|
|
@@ -615,6 +642,7 @@ export type InstituteData = {
|
|
|
615
642
|
approveAlumniMessages?: boolean;
|
|
616
643
|
anonymiseAlumniConvoStudents?: boolean;
|
|
617
644
|
alumniConversations?: boolean;
|
|
645
|
+
activityInvitesSent?: string;
|
|
618
646
|
} & Address;
|
|
619
647
|
export type ExternalActivity = {
|
|
620
648
|
title?: string;
|
|
@@ -627,6 +655,7 @@ export type ExternalActivity = {
|
|
|
627
655
|
alumni?: boolean;
|
|
628
656
|
provider?: boolean;
|
|
629
657
|
permanent?: boolean;
|
|
658
|
+
activityType: "workExperience" | "workplaceVisits" | "mentoring" | "mockInterviews" | "other";
|
|
630
659
|
};
|
|
631
660
|
export type NotificationObject = {
|
|
632
661
|
buttonURL: string;
|
|
@@ -676,7 +705,7 @@ export type StaffRoles = {
|
|
|
676
705
|
};
|
|
677
706
|
staff: string[];
|
|
678
707
|
};
|
|
679
|
-
export type QueryObjectConstraint = [string, "==" | "<" | "<=" | ">=" | ">" | "!=" | "array-contains" | "array-contains-any" | "in" | "not-in", string | boolean][];
|
|
708
|
+
export type QueryObjectConstraint = [string, "==" | "<" | "<=" | ">=" | ">" | "!=" | "array-contains" | "array-contains-any" | "in" | "not-in", string | boolean | string[]][];
|
|
680
709
|
export type QueryObject = {
|
|
681
710
|
path: string[];
|
|
682
711
|
where?: QueryObjectConstraint;
|
|
@@ -726,7 +755,7 @@ export type CohortData = {
|
|
|
726
755
|
endSubmission: string;
|
|
727
756
|
startPlacements: string;
|
|
728
757
|
endPlacements: string;
|
|
729
|
-
stage: "info" | "name" | "placementType" | "students" | "workflow" | "review" | "created" | "archived";
|
|
758
|
+
stage: "info" | "name" | "placementType" | "students" | "workflow" | "review" | "created" | "archived" | "database";
|
|
730
759
|
workflow: WorkflowStage[];
|
|
731
760
|
customWorkflow?: boolean;
|
|
732
761
|
oId: string;
|
|
@@ -735,6 +764,8 @@ export type CohortData = {
|
|
|
735
764
|
designatedStaff?: string;
|
|
736
765
|
autoArchiveDate?: string;
|
|
737
766
|
logType?: "basic" | "custom";
|
|
767
|
+
listingReleaseDate?: string;
|
|
768
|
+
enableListings?: boolean;
|
|
738
769
|
logs?: {
|
|
739
770
|
students?: string;
|
|
740
771
|
staff?: string;
|
|
@@ -756,6 +787,15 @@ export type CohortData = {
|
|
|
756
787
|
[key in keyof typeof emailTemplates]: string;
|
|
757
788
|
};
|
|
758
789
|
skillsTargets?: string[];
|
|
790
|
+
recurringEmails?: {
|
|
791
|
+
sendType?: "all" | "lastWeek";
|
|
792
|
+
frequency?: "oneTime" | "weeklyMonday" | "fortnightlyMonday";
|
|
793
|
+
};
|
|
794
|
+
savedDataViewerFilters?: {
|
|
795
|
+
[key in "cohortPlacements" | "cohortStudents"]: {
|
|
796
|
+
[key: string]: DataViewerFilterView;
|
|
797
|
+
};
|
|
798
|
+
};
|
|
759
799
|
};
|
|
760
800
|
export type ArrowObject = {
|
|
761
801
|
start: number | string;
|
|
@@ -846,6 +886,11 @@ export type PlacementReviewDetails = {
|
|
|
846
886
|
};
|
|
847
887
|
primaryColor?: string;
|
|
848
888
|
primaryImage?: string;
|
|
889
|
+
savedBySchool?: boolean;
|
|
890
|
+
consentedActivities?: string[];
|
|
891
|
+
instituteActivities?: {
|
|
892
|
+
[key: string]: ExternalActivity;
|
|
893
|
+
};
|
|
849
894
|
};
|
|
850
895
|
export type BlogCategories = "students" | "providers" | "institutes" | "placementt";
|
|
851
896
|
export type Blog = {
|
|
@@ -1010,7 +1055,7 @@ export type EmailTemplateConfig = {
|
|
|
1010
1055
|
text: string;
|
|
1011
1056
|
link: string;
|
|
1012
1057
|
};
|
|
1013
|
-
type: "workflow" | "feedback";
|
|
1058
|
+
type: "workflow" | "feedback" | "event";
|
|
1014
1059
|
};
|
|
1015
1060
|
export type Reminder = {
|
|
1016
1061
|
collection: "users" | "placements" | "placementListings";
|
|
@@ -1049,10 +1094,16 @@ export type SchoolData = OrganisationAddress & {
|
|
|
1049
1094
|
export type ExternalEvent = {
|
|
1050
1095
|
name: string;
|
|
1051
1096
|
description: string;
|
|
1097
|
+
staffInformation?: string;
|
|
1098
|
+
studentInformation?: string;
|
|
1099
|
+
employerInformation?: string;
|
|
1100
|
+
designatedStaff: string;
|
|
1052
1101
|
created: string;
|
|
1053
1102
|
activityId?: string;
|
|
1103
|
+
gatsbyBenchmarks?: string;
|
|
1054
1104
|
oId: string;
|
|
1055
1105
|
submissionClose: string;
|
|
1106
|
+
acceptingEmployers?: boolean;
|
|
1056
1107
|
schoolId?: string;
|
|
1057
1108
|
startDate?: string;
|
|
1058
1109
|
endDate?: string;
|
|
@@ -1077,6 +1128,23 @@ export type ExternalEvent = {
|
|
|
1077
1128
|
[key: string]: unknown;
|
|
1078
1129
|
};
|
|
1079
1130
|
};
|
|
1131
|
+
employerFeedback: {
|
|
1132
|
+
files: string[];
|
|
1133
|
+
forms: string[];
|
|
1134
|
+
requiredFiles: {
|
|
1135
|
+
fileName: string;
|
|
1136
|
+
fileType: string;
|
|
1137
|
+
}[];
|
|
1138
|
+
};
|
|
1139
|
+
studentFeedback: {
|
|
1140
|
+
files: string[];
|
|
1141
|
+
forms: string[];
|
|
1142
|
+
requiredFiles: {
|
|
1143
|
+
fileName: string;
|
|
1144
|
+
fileType: string;
|
|
1145
|
+
}[];
|
|
1146
|
+
};
|
|
1147
|
+
completedStages: ("basicDetails" | "employerInvites" | "studentInvites" | "employerSelection" | "feedback")[];
|
|
1080
1148
|
} & Address;
|
|
1081
1149
|
export type Alumni = {
|
|
1082
1150
|
forename: string;
|
|
@@ -1151,3 +1219,22 @@ export type Update = {
|
|
|
1151
1219
|
date: string;
|
|
1152
1220
|
imageData?: boolean;
|
|
1153
1221
|
};
|
|
1222
|
+
export type ExternalEventAttendee = {
|
|
1223
|
+
oId: string;
|
|
1224
|
+
eventId: string;
|
|
1225
|
+
providerContactId: string;
|
|
1226
|
+
status: "invited" | "providerAvailable" | "finalConfirmationSent" | "providerConfirmed" | "feedbackSent";
|
|
1227
|
+
emails: {
|
|
1228
|
+
[k in "invited" | "finalConfirmationSent" | "feedbackSent"]: {
|
|
1229
|
+
sent: number;
|
|
1230
|
+
reconciled: string | boolean;
|
|
1231
|
+
log: {
|
|
1232
|
+
[k: string]: string;
|
|
1233
|
+
};
|
|
1234
|
+
};
|
|
1235
|
+
};
|
|
1236
|
+
attended?: boolean;
|
|
1237
|
+
feedback: {
|
|
1238
|
+
[key: string]: unknown;
|
|
1239
|
+
};
|
|
1240
|
+
};
|
package/lib/util.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AlumniConversation, FlagCodes, InstituteData, StudentPlacementData, UserData, WorkflowStage } from "./typeDefinitions";
|
|
1
|
+
import { AlumniConversation, EmailTemplateConfig, FlagCodes, InstituteData, StudentPlacementData, UserData, WorkflowStage } from "./typeDefinitions";
|
|
2
|
+
import { Descendant } from "slate";
|
|
2
3
|
type PlacementFlagCodeParams = {
|
|
3
4
|
placement: StudentPlacementData;
|
|
4
5
|
studentData: UserData;
|
|
@@ -20,4 +21,27 @@ export declare const getMostRecentAlumniMessage: (conversation: AlumniConversati
|
|
|
20
21
|
delivered: "blocked" | "pending" | true;
|
|
21
22
|
id: string;
|
|
22
23
|
} | null;
|
|
24
|
+
export declare function buildEmailHTML({ preheader, title, salutation, body, primaryColor, secondaryBody, primaryButton, secondaryButton, primaryImage, designatedStaffEmail, organisationName, params, data }: {
|
|
25
|
+
preheader: string;
|
|
26
|
+
title: string;
|
|
27
|
+
salutation?: string;
|
|
28
|
+
body: string | Descendant[];
|
|
29
|
+
primaryColor?: string;
|
|
30
|
+
secondaryBody?: string;
|
|
31
|
+
primaryButton?: {
|
|
32
|
+
title: string;
|
|
33
|
+
url: string;
|
|
34
|
+
};
|
|
35
|
+
secondaryButton?: {
|
|
36
|
+
title: string;
|
|
37
|
+
url: string;
|
|
38
|
+
};
|
|
39
|
+
primaryImage?: string;
|
|
40
|
+
designatedStaffEmail?: string;
|
|
41
|
+
organisationName?: string;
|
|
42
|
+
params?: EmailTemplateConfig;
|
|
43
|
+
data?: {
|
|
44
|
+
[key: string]: string | undefined;
|
|
45
|
+
};
|
|
46
|
+
}): string;
|
|
23
47
|
export {};
|
package/lib/util.js
CHANGED
|
@@ -5,9 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getMostRecentAlumniMessage = exports.getPlacementFlagCodes = void 0;
|
|
7
7
|
exports.objectsEqualNew = objectsEqualNew;
|
|
8
|
+
exports.buildEmailHTML = buildEmailHTML;
|
|
8
9
|
const firestore_1 = require("firebase/firestore");
|
|
9
10
|
const firebaseQuery_1 = __importDefault(require("./firebase/firebaseQuery"));
|
|
10
11
|
const util_1 = require("./firebase/util");
|
|
12
|
+
const constants_1 = require("./constants");
|
|
11
13
|
const getPlacementFlagCodes = async ({ placement, studentData, workflow, institute, user }) => {
|
|
12
14
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
13
15
|
let flags = placement.flags || [];
|
|
@@ -23,8 +25,8 @@ const getPlacementFlagCodes = async ({ placement, studentData, workflow, institu
|
|
|
23
25
|
// If placement after provider review and not verified
|
|
24
26
|
const placementIsPostProviderReview = placement.leadTimes.some((x) => x.split("_")[0] === "3");
|
|
25
27
|
const placementNotEnded = !placement.leadTimes.some((x) => x.split("_")[0] === "8");
|
|
26
|
-
const providerUnverified = placement.
|
|
27
|
-
const awaitingProviderInsurance = placement.
|
|
28
|
+
const providerUnverified = placement.providerContactId && !((_b = institute === null || institute === void 0 ? void 0 : institute.verifiedProviders) === null || _b === void 0 ? void 0 : _b.includes(placement.providerContactId));
|
|
29
|
+
const awaitingProviderInsurance = placement.providerContactId && ((_c = institute === null || institute === void 0 ? void 0 : institute.awaitingProviderInsurance) === null || _c === void 0 ? void 0 : _c.includes(placement.providerContactId));
|
|
28
30
|
const riskAssessmentNotVerified = !((_d = institute === null || institute === void 0 ? void 0 : institute.verifiedRiskAssessments) === null || _d === void 0 ? void 0 : _d.includes(placement.placementId || placement.id));
|
|
29
31
|
const awaitingRiskAssessment = !placement.riskAssessment || ((_e = institute === null || institute === void 0 ? void 0 : institute.awaitingPlacementRiskAssessments) === null || _e === void 0 ? void 0 : _e.includes(placement.placementId || placement.id));
|
|
30
32
|
const dbsCheckNotVerified = !((_f = institute === null || institute === void 0 ? void 0 : institute.verifiedDbsChecks) === null || _f === void 0 ? void 0 : _f.includes(placement.placementId || placement.id));
|
|
@@ -148,4 +150,329 @@ const getMostRecentAlumniMessage = (conversation) => {
|
|
|
148
150
|
return mostRecent || null; // Return most recent or null if none found
|
|
149
151
|
};
|
|
150
152
|
exports.getMostRecentAlumniMessage = getMostRecentAlumniMessage;
|
|
153
|
+
function buildEmailHTML({ preheader, title, salutation, body, primaryColor = constants_1.PRIMARY_COLOUR, secondaryBody, primaryButton, secondaryButton, primaryImage = "http://cdn.mcauto-images-production.sendgrid.net/d17240a596025cf2/637d5af1-79d2-42c9-a663-e88abfea32b9/686x143.png", designatedStaffEmail, organisationName, params, data }) {
|
|
154
|
+
const serialiseSlate = (nodes) => {
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
|
+
return nodes.map((n) => {
|
|
157
|
+
if (n.type === "paragraph") {
|
|
158
|
+
const text = [];
|
|
159
|
+
for (let i = 0; i < n.children.length; i++) {
|
|
160
|
+
const item = n.children[i];
|
|
161
|
+
let subtext = item.text || "<br/>";
|
|
162
|
+
console.log("serialise text", subtext);
|
|
163
|
+
subtext = subtext.replace("", "");
|
|
164
|
+
if (item.underline) {
|
|
165
|
+
subtext = `<u>${subtext}</u>`;
|
|
166
|
+
}
|
|
167
|
+
if (item.bold) {
|
|
168
|
+
subtext = `<strong>${subtext}</strong>`;
|
|
169
|
+
}
|
|
170
|
+
if (item.italic) {
|
|
171
|
+
subtext = `<i>${subtext}</i>`;
|
|
172
|
+
}
|
|
173
|
+
text.push(subtext);
|
|
174
|
+
}
|
|
175
|
+
return `<div style="font-family: inherit; text-align: inherit">${text.join("")}</div>`;
|
|
176
|
+
}
|
|
177
|
+
return;
|
|
178
|
+
}).filter((a) => a).join("<div style=\"font-family: inherit; text-align: inherit\"><br></div>");
|
|
179
|
+
};
|
|
180
|
+
const getEmailContentFromTemplate = (template, params, data) => {
|
|
181
|
+
let finalBody = typeof template === "string" ? template : serialiseSlate(template);
|
|
182
|
+
console.log("Body before processing", finalBody);
|
|
183
|
+
// Replace all instances of placeholder with actual data.
|
|
184
|
+
[...params.params, ...Object.keys(data)].forEach((param) => {
|
|
185
|
+
console.log(`Replacing {{${param}}} with "${data[param]}"`);
|
|
186
|
+
finalBody = finalBody.replace(`{{${param}}}`, data[param]);
|
|
187
|
+
});
|
|
188
|
+
console.log("Processed body", finalBody);
|
|
189
|
+
// Still have the {{button}} elements to replace. In this case, split the string up between the button elements.
|
|
190
|
+
const itemsInBody = finalBody.split(/(\{\{button\}\})/);
|
|
191
|
+
const itemsInBodyWithFormattedButtons = itemsInBody.map((item) => {
|
|
192
|
+
if (item !== "{{button}}" || !params.button)
|
|
193
|
+
return item;
|
|
194
|
+
let title = params.button.text;
|
|
195
|
+
let url = "https://placementt.co.uk" + params.button.link;
|
|
196
|
+
// Replace any params in the url or title with the relevant data.
|
|
197
|
+
[...params.params, ...Object.keys(data)].forEach((param) => {
|
|
198
|
+
title = title.replace(`{{${param}}}`, data[param]);
|
|
199
|
+
});
|
|
200
|
+
[...params.params, ...Object.keys(data)].forEach((param) => {
|
|
201
|
+
url = url.replace(`{{${param}}}`, data[param]);
|
|
202
|
+
});
|
|
203
|
+
return {
|
|
204
|
+
title: title,
|
|
205
|
+
url: url,
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
return itemsInBodyWithFormattedButtons;
|
|
209
|
+
};
|
|
210
|
+
let formattedBody = (params && data) ? "" : body;
|
|
211
|
+
let formattedSecondaryBody = (params && data) ? "" : secondaryBody;
|
|
212
|
+
let formattedPrimaryButton = (params && data) ? undefined : primaryButton;
|
|
213
|
+
let formattedSecondaryButton = (params && data) ? undefined : secondaryButton;
|
|
214
|
+
if (params && data) {
|
|
215
|
+
const processedBody = getEmailContentFromTemplate(body, params, data);
|
|
216
|
+
processedBody.forEach((item) => {
|
|
217
|
+
if (typeof item === "string") {
|
|
218
|
+
if (!formattedBody) {
|
|
219
|
+
formattedBody = item;
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
formattedSecondaryBody = item;
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
// Must be a button
|
|
226
|
+
if (!formattedPrimaryButton) {
|
|
227
|
+
formattedPrimaryButton = item;
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
formattedSecondaryButton = item;
|
|
231
|
+
});
|
|
232
|
+
formattedBody = processedBody[0];
|
|
233
|
+
}
|
|
234
|
+
const emailHeadAndStylesHTML = `
|
|
235
|
+
<head>
|
|
236
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
237
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
|
|
238
|
+
<!--[if !mso]><!-->
|
|
239
|
+
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
|
240
|
+
<!--<![endif]--><!--[if (gte mso 9)|(IE)]>
|
|
241
|
+
<xml>
|
|
242
|
+
<o:OfficeDocumentSettings>
|
|
243
|
+
<o:AllowPNG/>
|
|
244
|
+
<o:PixelsPerInch>96</o:PixelsPerInch>
|
|
245
|
+
</o:OfficeDocumentSettings>
|
|
246
|
+
</xml>
|
|
247
|
+
<![endif]--><!--[if (gte mso 9)|(IE)]>
|
|
248
|
+
<style type="text/css"> body {width: 600px;margin: 0 auto;} table {border-collapse: collapse;} table, td {mso-table-lspace: 0pt;mso-table-rspace: 0pt;} img {-ms-interpolation-mode: bicubic;} </style>
|
|
249
|
+
<![endif]-->
|
|
250
|
+
<style type="text/css"> body, p, div {font-family: inherit;font-size: 14px;} body {color: #000000;} body a {color: #000000;text-decoration: none;} p { margin: 0; padding: 0; } table.wrapper {width:100% !important;table-layout: fixed;-webkit-font-smoothing: antialiased;-webkit-text-size-adjust: 100%;-moz-text-size-adjust: 100%;-ms-text-size-adjust: 100%;} img.max-width {max-width: 100% !important;} .column.of-2 {width: 50%;} .column.of-3 {width: 33.333%;} .column.of-4 {width: 25%;} ul ul ul ul {list-style-type: disc !important;} ol ol {list-style-type: lower-roman !important;} ol ol ol {list-style-type: lower-latin !important;} ol ol ol ol {list-style-type: decimal !important;} @media screen and (max-width:480px) {.preheader .rightColumnContent, .footer .rightColumnContent {text-align: left !important;} .preheader .rightColumnContent div, .preheader .rightColumnContent span, .footer .rightColumnContent div, .footer .rightColumnContent span {text-align: left !important;} .preheader .rightColumnContent, .preheader .leftColumnContent {font-size: 80% !important;padding: 5px 0;} table.wrapper-mobile {width: 100% !important;table-layout: fixed;} img.max-width {height: auto !important;max-width: 100% !important;} a.bulletproof-button {display: block !important;width: auto !important;font-size: 80%;padding-left: 0 !important;padding-right: 0 !important;} .columns {width: 100% !important;} .column {display: block !important;width: 100% !important;padding-left: 0 !important;padding-right: 0 !important;margin-left: 0 !important;margin-right: 0 !important;} .social-icon-column {display: inline-block !important;} } </style>
|
|
251
|
+
<style> @media screen and (max-width:480px) {table\0 {width: 480px !important;} } </style>
|
|
252
|
+
<!--user entered Head Start-->
|
|
253
|
+
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
|
|
254
|
+
<style> * {font-family: 'nunito', sans-serif;} </style>
|
|
255
|
+
<!--End Head user entered-->
|
|
256
|
+
</head>
|
|
257
|
+
`;
|
|
258
|
+
const primaryButtonTextLinkHTML = formattedPrimaryButton ? `
|
|
259
|
+
<tr>
|
|
260
|
+
<td style="padding:0px 15px 0px 15px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content">
|
|
261
|
+
<div>
|
|
262
|
+
<div style="font-family: inherit; text-align: inherit">Or go to <a href="${formattedPrimaryButton.url}">${formattedPrimaryButton.url}</a></div>
|
|
263
|
+
<div></div>
|
|
264
|
+
</div>
|
|
265
|
+
</td>
|
|
266
|
+
</tr>` : "";
|
|
267
|
+
const primaryButtonHTML = formattedPrimaryButton ? `
|
|
268
|
+
<tr>
|
|
269
|
+
<td align="center" bgcolor="${primaryColor}" class="inner-td" style="border-radius:6px; font-size:16px; text-align:center; background-color:inherit;"><a href="${formattedPrimaryButton.url}" style="background-color:${primaryColor}; border:1px solid #ffffff; border-color:#ffffff; border-radius:30px; border-width:1px; color:#ffffff; display:inline-block; font-size:16px; font-weight:normal; letter-spacing:0px; line-height:normal; padding:12px 40px 12px 40px; text-align:center; text-decoration:none; border-style:solid; font-family:nunito,sans-serif;" target="_blank">${formattedPrimaryButton.title}</a></td>
|
|
270
|
+
</tr>` : "";
|
|
271
|
+
const secondaryButtonTextHTML = formattedSecondaryButton ? `
|
|
272
|
+
<tr>
|
|
273
|
+
<td align="center" class="inner-td" style="text-align:center; background-color:inherit;"><a href="${formattedSecondaryButton.url}" style="display:inline-block; font-weight:normal; color:#aeaeae; letter-spacing:0px; line-height:normal; text-align:center; text-decoration:none; font-family:nunito,sans-serif;" target="_blank">${formattedSecondaryButton.title}</a></td>
|
|
274
|
+
</tr>` : "";
|
|
275
|
+
const buttonTableHTML = (primaryButtonHTML || secondaryButtonTextHTML) ? `
|
|
276
|
+
<table border="0" cellpadding="0" cellspacing="0" class="module" data-role="module-button" data-type="button" role="module" style="table-layout:fixed;" width="100%" data-muid="3757586a-ce69-48ba-bd9a-0c0b7937a616">
|
|
277
|
+
<tbody>
|
|
278
|
+
<tr>
|
|
279
|
+
<td align="center" bgcolor="" class="outer-td" style="padding:0px 0px 40px 0px;">
|
|
280
|
+
<table border="0" cellpadding="0" cellspacing="0" class="wrapper-mobile" style="text-align:center;">
|
|
281
|
+
<tbody>
|
|
282
|
+
${primaryButtonHTML}
|
|
283
|
+
${secondaryButtonTextHTML}
|
|
284
|
+
</tbody>
|
|
285
|
+
</table>
|
|
286
|
+
</td>
|
|
287
|
+
</tr>
|
|
288
|
+
${primaryButtonTextLinkHTML}
|
|
289
|
+
</tbody>
|
|
290
|
+
</table>` : "";
|
|
291
|
+
const secondaryBodyHTML = formattedSecondaryBody ? `
|
|
292
|
+
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="c589a68d-fd31-4291-b822-cddb80753f13" data-mc-module-version="2019-10-22">
|
|
293
|
+
<tbody>
|
|
294
|
+
<tr>
|
|
295
|
+
<td style="padding:0px 15px 0px 15px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content">
|
|
296
|
+
<div>
|
|
297
|
+
<div style="font-family: inherit; text-align: inherit"><br></div>
|
|
298
|
+
<div style="font-family: inherit; text-align: inherit">${formattedSecondaryBody}</div>
|
|
299
|
+
<div></div>
|
|
300
|
+
</div>
|
|
301
|
+
</td>
|
|
302
|
+
</tr>
|
|
303
|
+
</tbody>
|
|
304
|
+
</table>` : "";
|
|
305
|
+
const organisationContactSentence = (designatedStaffEmail || organisationName) ?
|
|
306
|
+
`
|
|
307
|
+
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="50de54bb-94d0-4d21-a7f2-100719150961" data-mc-module-version="2019-10-22">
|
|
308
|
+
<tbody>
|
|
309
|
+
<tr>
|
|
310
|
+
<td style="padding:0px 15px 18px 15px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content">
|
|
311
|
+
<div>
|
|
312
|
+
|
|
313
|
+
<div style="font-family: inherit; text-align: inherit">
|
|
314
|
+
|
|
315
|
+
${organisationName ? `<span style="color: #aeaeae">This email was sent by Placementt on behalf of ${organisationName}.</span>` :
|
|
316
|
+
designatedStaffEmail ? `Please do not reply directly to this email. For any queries, contact <a href="mailto:${designatedStaffEmail}">${designatedStaffEmail}</a>` : ""}
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
</td>
|
|
320
|
+
</tr>
|
|
321
|
+
</tbody>
|
|
322
|
+
</table>` :
|
|
323
|
+
"";
|
|
324
|
+
return `<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
|
|
325
|
+
${emailHeadAndStylesHTML}
|
|
326
|
+
<body>
|
|
327
|
+
<center class="wrapper" data-link-color="#000000" data-body-style="font-size:14px; font-family:inherit; color:#000000; background-color:#F9F4FF;">
|
|
328
|
+
<div class="webkit">
|
|
329
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="wrapper" bgcolor="#F9F4FF">
|
|
330
|
+
<tbody>
|
|
331
|
+
<tr>
|
|
332
|
+
<td valign="top" bgcolor="#F9F4FF" width="100%">
|
|
333
|
+
<table width="100%" role="content-container" class="outer" align="center" cellpadding="0" cellspacing="0" border="0">
|
|
334
|
+
<tbody>
|
|
335
|
+
<tr>
|
|
336
|
+
<td width="100%">
|
|
337
|
+
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
338
|
+
<tbody>
|
|
339
|
+
<tr>
|
|
340
|
+
<td>
|
|
341
|
+
<!--[if mso]>
|
|
342
|
+
<center>
|
|
343
|
+
<table>
|
|
344
|
+
<tr>
|
|
345
|
+
<td width="600">
|
|
346
|
+
<![endif]-->
|
|
347
|
+
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; max-width:600px;" align="center">
|
|
348
|
+
<tbody>
|
|
349
|
+
<tr>
|
|
350
|
+
<td role="modules-container" style="padding:0px 0px 0px 0px; color:#000000; text-align:left;" bgcolor="#ffffff" width="100%" align="left">
|
|
351
|
+
<table class="module preheader preheader-hide" role="module" data-type="preheader" border="0" cellpadding="0" cellspacing="0" width="100%" style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;">
|
|
352
|
+
<tbody>
|
|
353
|
+
<tr>
|
|
354
|
+
<td role="module-content">
|
|
355
|
+
<p>${preheader}</p>
|
|
356
|
+
</td>
|
|
357
|
+
</tr>
|
|
358
|
+
</tbody>
|
|
359
|
+
</table>
|
|
360
|
+
<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%" role="module" data-type="columns" style="padding:20px 0px 20px 0px;" bgcolor="#ffffff" data-distribution="1">
|
|
361
|
+
<tbody>
|
|
362
|
+
<tr role="module-content">
|
|
363
|
+
<td height="100%" valign="top">
|
|
364
|
+
<table width="600" style="width:600px; border-spacing:0; border-collapse:collapse; margin:0px 0px 0px 0px;" cellpadding="0" cellspacing="0" align="left" border="0" bgcolor="" class="column column-0">
|
|
365
|
+
<tbody>
|
|
366
|
+
<tr>
|
|
367
|
+
<td style="padding:0px;margin:0px;border-spacing:0;">
|
|
368
|
+
<table class="wrapper" role="module" data-type="image" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="9f29c991-6500-41ef-9f0e-d56cb5dc1238">
|
|
369
|
+
<tbody>
|
|
370
|
+
<tr>
|
|
371
|
+
<td style="font-size:6px; line-height:10px; padding:0px 0px 0px 0px;" valign="top" align="center"><img class="max-width" border="0" style="display:block; color:#000000; text-decoration:none; font-family:Helvetica, arial, sans-serif; font-size:16px; max-width:52% !important; width:52%; height:auto !important; max-height: 100px; object-fit: contain" width="312" alt="" data-proportionally-constrained="false" data-responsive="true" src="${primaryImage}"></td>
|
|
372
|
+
</tr>
|
|
373
|
+
</tbody>
|
|
374
|
+
</table>
|
|
375
|
+
</td>
|
|
376
|
+
</tr>
|
|
377
|
+
</tbody>
|
|
378
|
+
</table>
|
|
379
|
+
</td>
|
|
380
|
+
</tr>
|
|
381
|
+
</tbody>
|
|
382
|
+
</table>
|
|
383
|
+
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="b35b8ff4-8b3c-4b35-9ed3-f9f25170affc" data-mc-module-version="2019-10-22">
|
|
384
|
+
<tbody>
|
|
385
|
+
<tr>
|
|
386
|
+
<td style="padding:20px 20px 18px 20px; line-height:28px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content">
|
|
387
|
+
<div>
|
|
388
|
+
<div style="font-family: nunito, sans-serif; text-align: center"><span style="font-size: 24px; font-family: inherit">${title}</span></div>
|
|
389
|
+
<div></div>
|
|
390
|
+
</div>
|
|
391
|
+
</td>
|
|
392
|
+
</tr>
|
|
393
|
+
</tbody>
|
|
394
|
+
</table>
|
|
395
|
+
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="c589a68d-fd31-4291-b822-cddb80753f13" data-mc-module-version="2019-10-22">
|
|
396
|
+
<tbody>
|
|
397
|
+
<tr>
|
|
398
|
+
<td style="padding:18px 15px 18px 15px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content">
|
|
399
|
+
<div>
|
|
400
|
+
${salutation ? `<div style="font-family: inherit; text-align: inherit"><span style="color: #000000; font-family: Colfax, Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; float: none; display: inline">${salutation},</span></div><div style="font-family: inherit; text-align: inherit"><br></div>` : ""}
|
|
401
|
+
<div style="font-family: inherit; text-align: inherit">${formattedBody}</div>
|
|
402
|
+
<div></div>
|
|
403
|
+
</div>
|
|
404
|
+
</td>
|
|
405
|
+
</tr>
|
|
406
|
+
</tbody>
|
|
407
|
+
</table>
|
|
408
|
+
${buttonTableHTML}
|
|
409
|
+
${secondaryBodyHTML}
|
|
410
|
+
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="50de54bb-94d0-4d21-a7f2-100719150961" data-mc-module-version="2019-10-22">
|
|
411
|
+
<tbody>
|
|
412
|
+
<tr>
|
|
413
|
+
<td style="padding:18px 15px 9px 15px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content">
|
|
414
|
+
<div>
|
|
415
|
+
<div style="font-family: inherit; text-align: inherit"><span style="color: #aeaeae">If you do not recognise this email, you can safely ignore it.</span></div>
|
|
416
|
+
<div></div>
|
|
417
|
+
</div>
|
|
418
|
+
</td>
|
|
419
|
+
</tr>
|
|
420
|
+
</tbody>
|
|
421
|
+
</table>
|
|
422
|
+
${organisationContactSentence}
|
|
423
|
+
<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%" role="module" data-type="columns" style="padding:0px 0px 0px 0px;" bgcolor="#FFFFFF" data-distribution="1">
|
|
424
|
+
<tbody>
|
|
425
|
+
<tr role="module-content">
|
|
426
|
+
<td height="100%" valign="top">
|
|
427
|
+
<table width="600" style="width:600px; border-spacing:0; border-collapse:collapse; margin:0px 0px 0px 0px;" cellpadding="0" cellspacing="0" align="left" border="0" bgcolor="" class="column column-0">
|
|
428
|
+
<tbody>
|
|
429
|
+
<tr>
|
|
430
|
+
<td style="padding:0px;margin:0px;border-spacing:0;">
|
|
431
|
+
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="a49405df-a253-4a28-8d3d-be95449c7d30" data-mc-module-version="2019-10-22">
|
|
432
|
+
<tbody>
|
|
433
|
+
<tr>
|
|
434
|
+
<td style="padding:18px 0px 18px 0px; line-height:0px; text-align:inherit; background-color:${primaryColor};" height="100%" valign="top" bgcolor="${primaryColor}" role="module-content">
|
|
435
|
+
<div>
|
|
436
|
+
<div style="font-family: inherit; text-align: center"><a href="http://"><span style="font-size: 12px; color: #ffffff; font-family: inherit">www.placementt.co.uk</span></a></div>
|
|
437
|
+
<div></div>
|
|
438
|
+
</div>
|
|
439
|
+
</td>
|
|
440
|
+
</tr>
|
|
441
|
+
</tbody>
|
|
442
|
+
</table>
|
|
443
|
+
</td>
|
|
444
|
+
</tr>
|
|
445
|
+
</tbody>
|
|
446
|
+
</table>
|
|
447
|
+
</td>
|
|
448
|
+
</tr>
|
|
449
|
+
</tbody>
|
|
450
|
+
</table>
|
|
451
|
+
</td>
|
|
452
|
+
</tr>
|
|
453
|
+
</tbody>
|
|
454
|
+
</table>
|
|
455
|
+
<!--[if mso]>
|
|
456
|
+
</td>
|
|
457
|
+
</tr>
|
|
458
|
+
</table>
|
|
459
|
+
</center>
|
|
460
|
+
<![endif]-->
|
|
461
|
+
</td>
|
|
462
|
+
</tr>
|
|
463
|
+
</tbody>
|
|
464
|
+
</table>
|
|
465
|
+
</td>
|
|
466
|
+
</tr>
|
|
467
|
+
</tbody>
|
|
468
|
+
</table>
|
|
469
|
+
</td>
|
|
470
|
+
</tr>
|
|
471
|
+
</tbody>
|
|
472
|
+
</table>
|
|
473
|
+
</div>
|
|
474
|
+
</center>
|
|
475
|
+
</body>
|
|
476
|
+
</html>`;
|
|
477
|
+
}
|
|
151
478
|
//# sourceMappingURL=util.js.map
|