Feature/parse json make email body #54
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Two-Step Flow Designer Action: JSON Parsing and Email Notification
This is a design document for a reusable, two-step Flow Designer Action for parsing a JSON payload and sending its contents in a well-formatted email (Text or HTML).
1. Action Name & Description
2. Step 1: Script - JSON Parser
This step contains the core logic for recursive JSON parsing and formatting.
2.1 Inputs
jsonStringemailSubjectemailTooutputFormatemailBody.2.2 Script Logic (Pseudo-code/Summary)
jsonStringis null or empty. If so, setemailBodyto an error message andstatusto 'Error'.jsonStringusing a built-in JSON parser function (e.g.,JSON.parse()).statusto 'Error'.emailBodyto a descriptive error message: "Error: Invalid JSON structure provided. Details: [Parsing Error Message]".formatJson(data, format)):<table>or ordered/unordered list (<ol>,<ul>).formatJson(parsedData, outputFormat). Set the returned string toemailBody.statusto 'Success'.2.3 Outputs
emailBodystatusemailSubjectemailTo3. Step 2: Email - Send Formatted Email
This step is a standard Email action that consumes the outputs from Step 1.
3.1 Inputs
$Step 1.emailTo$Step 1.emailSubject$Step 1.emailBodyoutputFormatchoice.3.2 Conditional Logic
4. Notable Features & Testing Summary
JSON Parser) is self-contained and reusable in other actions requiring JSON to structured text/HTML conversion.outputFormatChoice: Allows the caller to easily switch between simple text (for plain terminals/low-fidelity) and rich HTML (for better readability/branding).$Step 1.emailBodyand sent in the notification, immediately alerting the recipients to the parsing issue (e.g., a bad integration payload).emailTo.