@optimiser/common 1.0.389 → 1.0.391
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/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/lib/utility.d.ts +8 -1
- package/dist/lib/utility.js +36 -2
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
package/dist/lib/utility.d.ts
CHANGED
|
@@ -88,7 +88,14 @@ declare function MakeUserPasswordInvalid(options: AnyObjectInterface): void;
|
|
|
88
88
|
declare function ConvertJsonToXLXS(data: AnyObjectInterface, params: AnyObjectInterface | undefined, filePath: string): Promise<void>;
|
|
89
89
|
declare function SendResetPasswordMail(db: Db, userDetails: AnyObjectInterface, type?: string): Promise<unknown>;
|
|
90
90
|
declare function SendMailToSupport(mailData: AnyObjectInterface, callback: callBackInterface): void;
|
|
91
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Common Mail Template Structure
|
|
93
|
+
* @param {string} content It is html body content sent over mail
|
|
94
|
+
* @param {boolean} hasDontReplyContent boolean flag to conditionally append static footer do not reply content
|
|
95
|
+
* @param {boolean} isActivityTemplate boolean flag to conditionally use activity mail template instead of common mail template
|
|
96
|
+
* @reply {string} wraps the complete content structure
|
|
97
|
+
*/
|
|
98
|
+
declare function MailTemplateStructure(content: string, hasDontReplyContent?: boolean, isActivityTemplate?: boolean): string;
|
|
92
99
|
declare function SendMailToCustomer(mailData: AnyObjectInterface, callback: callBackInterface): void;
|
|
93
100
|
declare function parseMSPCookie(cookie: AnyObjectInterface): any;
|
|
94
101
|
declare function isEmptyObj(object: AnyObjectInterface): boolean;
|
package/dist/lib/utility.js
CHANGED
|
@@ -2106,6 +2106,10 @@ function BuildGridFieldProjection(project, field, group) {
|
|
|
2106
2106
|
//project[fldName] = JSON.parse(field.Schema.Formula);
|
|
2107
2107
|
project[fldName] = ToParseFormulaField(field.Schema.Formula);
|
|
2108
2108
|
break;
|
|
2109
|
+
case "texteditor":
|
|
2110
|
+
alias = fldName + constants_1.default.SummaryAlias;
|
|
2111
|
+
project[alias] = 1;
|
|
2112
|
+
break;
|
|
2109
2113
|
default:
|
|
2110
2114
|
project[fldName] = 1;
|
|
2111
2115
|
break;
|
|
@@ -3451,8 +3455,21 @@ function SendMailToSupport(mailData, callback) {
|
|
|
3451
3455
|
});
|
|
3452
3456
|
}
|
|
3453
3457
|
exports.SendMailToSupport = SendMailToSupport;
|
|
3454
|
-
|
|
3455
|
-
|
|
3458
|
+
/**
|
|
3459
|
+
* Common Mail Template Structure
|
|
3460
|
+
* @param {string} content It is html body content sent over mail
|
|
3461
|
+
* @param {boolean} hasDontReplyContent boolean flag to conditionally append static footer do not reply content
|
|
3462
|
+
* @param {boolean} isActivityTemplate boolean flag to conditionally use activity mail template instead of common mail template
|
|
3463
|
+
* @reply {string} wraps the complete content structure
|
|
3464
|
+
*/
|
|
3465
|
+
function MailTemplateStructure(content, hasDontReplyContent, isActivityTemplate) {
|
|
3466
|
+
if (isActivityTemplate === void 0) { isActivityTemplate = false; }
|
|
3467
|
+
if (isActivityTemplate) {
|
|
3468
|
+
return ACTIVITY_MAIL_TEMPLATE(content);
|
|
3469
|
+
}
|
|
3470
|
+
else {
|
|
3471
|
+
return COMMON_MAIL_TEMPLATE(content, hasDontReplyContent);
|
|
3472
|
+
}
|
|
3456
3473
|
/* `<body style='background-color: #eee;'>
|
|
3457
3474
|
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background:#eee;">
|
|
3458
3475
|
<tr>
|
|
@@ -5734,3 +5751,20 @@ function ValidateStateCountryField(_a) {
|
|
|
5734
5751
|
});
|
|
5735
5752
|
});
|
|
5736
5753
|
}
|
|
5754
|
+
/**
|
|
5755
|
+
* Activity Mail Template Structure
|
|
5756
|
+
* @param {string} content It is html body content sent over mail
|
|
5757
|
+
* @reply {string} wraps the complete content structure
|
|
5758
|
+
*/
|
|
5759
|
+
var ACTIVITY_MAIL_TEMPLATE = function (content) {
|
|
5760
|
+
return "<html xmlns:v=\"urn:schemas-microsoft-com:vml\">\n <head>\n <style> v:* { behavior: url(#default#VML); }</style >\n </head>\n <body style='background-color: #fff;'>\n <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n <!-- <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\"> -->\n <tr>\n <td align=\"center\" valign=\"top\">\n <table width=\"650\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\">\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#fff\" style=\"background-color: #fff; text-align: left; padding-right: 0px; padding-left: 0px; font-size:16px; font-family:Arial, Helvetica, sans-serif; color:#000000;\">\n ".concat(content, "\n <p style=\"margin-bottom: 1em;\">\n Thanks,<br>\n ").concat(constants_1.default.ProjectName, " team\n </p>\n </td>\n </tr> \n </table>\n <tr>\n <td>\n <tr>\n <td style=\"text-align: center;\">\n <table style=\"margin: 0 auto;\">\n <tr>\n <td style=\"padding: 3px; font-size:13px; font-family:Arial, Helvetica, sans-serif;\">Powered By</td>\n <td style=\"padding: 3px;\"><a target=\"_blank\" href=\"https://www.optimiser.com\"><img src=\"https://platform.optimiser.com/images/MainLogo.png\" style=\"height: 45px;\"></a></td>\n </tr>\n </table>\n </td>\n </tr>\n </td>\n </tr>\n </td>\n </tr>\n </table>\n </body>");
|
|
5761
|
+
};
|
|
5762
|
+
/**
|
|
5763
|
+
* Common Mail Template Structure
|
|
5764
|
+
* @param {string} content It is html body content sent over mail
|
|
5765
|
+
* @param {boolean} hasDontReplyContent boolean flag to conditionally append static footer do not reply content
|
|
5766
|
+
* @reply {string} wraps the complete content structure
|
|
5767
|
+
*/
|
|
5768
|
+
var COMMON_MAIL_TEMPLATE = function (content, hasDontReplyContent) {
|
|
5769
|
+
return "<html xmlns:v=\"urn:schemas-microsoft-com:vml\">\n <head>\n <style> v:* { behavior: url(#default#VML); }</style >\n </head>\n <body style='background-color: #fff;'>\n <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n <!-- <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\"> -->\n <tr>\n <td align=\"center\" valign=\"top\">\n <table width=\"650\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#fff;\">\n <tr>\n <td align=\"left\" valign=\"top\" bgcolor=\"#ffffff\" style=\"padding-top:16px; padding-bottom:12px; padding-left: 20px; padding-right: 20px; background-color: #fff; border-bottom: 1px solid #fff;\">\n <img src=\"https://platform.optimiser.com/images/MainLogo.png\" alt=\"Optimiser\"/>\n </td>\n </tr>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#fff\" style=\"background-color: #fff; text-align: left; padding-right: 0px; padding-left: 0px; font-size:16px; font-family:Arial, Helvetica, sans-serif; color:#000000;\">\n ".concat(content, "\n <p style=\"margin-bottom: 1em;\">\n Thanks,<br>\n ").concat(constants_1.default.ProjectName, " team\n </p>\n </td>\n </tr>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"##075DA8\" style=\" border-top: 1px solid #dee2e6; background-color: #075DA8;\">\n <p style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; color:#fff; margin:1.8em; font-weight:normal;\">\n <a href=\"https://www.optimiser.com/\" style=\"color:#fff; text-decoration:underline; \">www.optimiser.com</a> | <a href=\"mailto:support@optimiser.com\" style=\"color:#fff; text-decoration:underline; \">support@optimiser.com</a> | \n +44 (0)203 972 1666\n </p>\n </td>\n </tr>\n ").concat(hasDontReplyContent === true ? "<tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#fff\" style=\"margin-top: 1em;background-color: #fff; text-align: left; padding-right: 0px; padding-left: 0px; font-size:13px; font-family:Arial, Helvetica, sans-serif; color:#000000;\">\n <p style=\"margin-top: 1em;\">\n ##DonotReplyContent##\n </p>\n </td>\n </tr>" : '', " \n </table>\n </td>\n </tr>\n </table>\n </body>");
|
|
5770
|
+
};
|