Cannot input a large html template as a string


#1

We have a lot of reports rendered in PDFs. So many of our API have PDF responses. So, when the Object Repository is created and successfully tested. Converting the OR to a test case throwing 400 error.

Any thoughts, please ?

Here is the JSON request : The htmlTemplate field takes a giant encoded html report template.

{
“baseUrl”: “https://some.com”,
“Id”: “59a73febe1413942fc8fbb46”,
“htmlTemplate”: “”,
“options”: {
“select”: “_id name description siteid parentsiteid type status”,
“populate”: [
{
“path”: “landingPage.templateOriginId”,
“select”: “_id email firstName lastName”
}
]
},
“timezoneOffset”: 0,
“unique”: true,
“userNote”: “Test Report”,
“orientation”: “Serve the Customers”,
“Siteid”: 1104416900
}

Here is the encoded html template goes as an input at JSON ‘htmlTemplate’ field :

Campaign Report Overview\n\t\t/* What it does: Remove spaces around the email design added by some email clients. */\n\t\t/* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */\n\t\thtml,\n\t\tbody {\n\t\t\tmargin: 0 !important;\n\t\t\tpadding: 0 !important;\n\t\t\theight: 100% !important;\n\t\t\twidth: 100% !important;\n\t\t}\n\n\t\t/* What it does: Stops email clients resizing small text. */\n\t\t* {\n\t\t\t-ms-text-size-adjust: 100%;\n\t\t\t-webkit-text-size-adjust: 100%;\n\t\t}\n\n\t\t/* What it does: Forces Outlook.com to display emails full width. */\n\t\t.ExternalClass {\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t/* What is does: Centers email on Android 4.4 */\n\t\tdiv[style*=\"margin: 16px 0\"] {\n\t\t\tmargin: 0 !important;\n\t\t}\n\n\t\t/* What it does: Stops Outlook from adding extra spacing to tables. */\n\t\ttable,\n\t\ttd {\n\t\t\tmso-table-lspace: 0pt !important;\n\t\t\tmso-table-rspace: 0pt !important;\n\t\t}\n\n\t\t/* What it does: Fixes webkit padding issue. Fix for Yahoo mail table alignment bug. Applies table-layout to the first 2 tables then removes for anything nested deeper. */\n\t\ttable {\n\t\t\tborder-spacing: 0 !important;\n\t\t\tborder-collapse: collapse !important;\n\t\t\ttable-layout: fixed !important;\n\t\t\tmargin: 0 auto !important;\n\t\t}\n\n\t\ttable table table {\n\t\t\ttable-layout: auto;\n\t\t}\n\n\t\t/* What it does: Uses a better rendering method when resizing images in IE. */\n\t\timg {\n\t\t\t-ms-interpolation-mode: bicubic;\n\t\t}\n\n\t\t/* What it does: Overrides styles added when Yahoo's auto-senses a link. */\n\t\t.yshortcuts a {\n\t\t\tborder-bottom: none !important;\n\t\t}\n\n\t\t/* What it does: Another work-around for iOS meddling in triggered links. */\n\t\ta[x-apple-data-detectors] {\n\t\t\tcolor: inherit !important;\n\t\t}\n\t\n\t\t/* What it does: Hover styles for buttons */\n\t\t.button-td,\n\t\t.button-a {\n\t\t\ttransition: all 100ms ease-in;\n\t\t}\n\n\t\t.button-td:hover,\n\t\t.button-a:hover {\n\t\t\tbackground: #333333 !important;\n\t\t\tborder-color: #333333 !important;\n\t\t}\n\n\t\t/* Media Queries */\n\t\t@media screen and (max-width: 600px) {\n\t\t\t.email-container {\n\t\t\t\twidth: 100% !important;\n\t\t\t}\n\n\t\t\t/* What it does: Forces elements to resize to the full width of their container. Useful for resizing images beyond their max-width. */\n\t\t\t.fluid,\n\t\t\t.fluid-centered {\n\t\t\t\tmax-width: 100% !important;\n\t\t\t\theight: auto !important;\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t\t/* And center justify these ones. */\n\t\t\t.fluid-centered {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\n\t\t\t/* What it does: Forces table cells into full-width rows. */\n\t\t\t.stack-column,\n\t\t\t.stack-column-center {\n\t\t\t\tdisplay: block !important;\n\t\t\t\twidth: 100% !important;\n\t\t\t\tmax-width: 100% !important;\n\t\t\t\tdirection: ltr !important;\n\t\t\t}\n\t\t\t/* And center justify these ones. */\n\t\t\t.stack-column-center {\n\t\t\t\ttext-align: center !important;\n\t\t\t}\n\n\t\t\t/* What it does: Generic utility class for centering. Useful for images, buttons, and nested tables. */\n\t\t\t.center-on-narrow {\n\t\t\t\ttext-align: center !important;\n\t\t\t\tdisplay: block !important;\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t\tfloat: none !important;\n\t\t\t}\n\t\t\ttable.center-on-narrow {\n\t\t\t\tdisplay: inline-block !important;\n\t\t\t}\n\t\t}\n\n\t\t/* ADDED BY WSAT TEAM: Create hard page breaks for PDF generator. */\n\t\thr.page-break-here {\n\t\t\tpage-break-after: always;\n\t\t\theight: 0px;\n\t\t\tvisibility: hidden;\n\t\t}\n\t
{{#if campaign.description}}{{/if}}{{#if computed.hasPhishingEmail}}{{/if}} {{#if computed.hasLandingPage}}{{/if}} {{#if computed.courseName}}{{/if}}
TITLE:
{{campaign.name}}
LAUNCH DATE:
{{dateOnly campaign.launchDate timezoneOffset}}
{{timeOnly campaign.launchDate timezoneOffset}}
TARGET USERS:
{{computed.targetUserCount}}
DESCRIPTION:
{{campaign.description}}
NOTES:
{{custom.userNotes}}

Raise awareness and decrease risk with ongoing phishing simulations and courses.
Events:
Risk: {{computed.riskPercentage}}%
TEMPLATE USED:
{{computed.phishingEmailName}}
LURE USED:
{{computed.landingPageName}}
EDUCATION/COURSE USED:
{{computed.courseName}}

LURE EMAIL USED:
\"Lure
LURE USED:
\"Lure
 
</html