Skip to content

Conversation

@anurampalli
Copy link
Contributor

…text or HTML.

Use Case:
Automatically alert support teams and management of high-priority incidents, including all relevant fields, in a well-formatted email.

Step 1 – Script:

Recursively parses JSON (jsonString) into text or HTML (tables/lists).

Supports nested objects and arrays.

Outputs emailBody and status.

Step 2 – Email:

Sends the formatted email using emailTo and emailSubject.

Script step is modular and reusable.

Notable Features:

outputFormat choice input added.

Handles empty/invalid JSON gracefully with descriptive error messages in email body.

Testing:

Verified both text and HTML outputs.

Confirmed emails to multiple recipients.

Errors in JSON parsing appear in the email body instead of failing silently.

…text or HTML.

Use Case:
Automatically alert support teams and management of high-priority incidents, including all relevant fields, in a well-formatted email.

Step 1 – Script:

Recursively parses JSON (jsonString) into text or HTML (tables/lists).

Supports nested objects and arrays.

Outputs emailBody and status.

Step 2 – Email:

Sends the formatted email using emailTo and emailSubject.

Script step is modular and reusable.

Notable Features:

outputFormat choice input added.

Handles empty/invalid JSON gracefully with descriptive error messages in email body.

Testing:

Verified both text and HTML outputs.

Confirmed emails to multiple recipients.

Errors in JSON parsing appear in the email body instead of failing silently.
@github-actions
Copy link

github-actions bot commented Oct 4, 2025

Valid PR for ActionPack

Thank you for your contribution. This PR complies with the CONTRIBUTING.md.
A maintainer will review this shortly. In the meantime, Happy Hacking!

@am-shakeel am-shakeel self-assigned this Oct 4, 2025
Copy link
Contributor

@am-shakeel am-shakeel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@am-shakeel am-shakeel merged commit f2610c4 into ServiceNowDevProgram:main Oct 4, 2025
2 checks passed
@anurampalli
Copy link
Contributor Author

Thank you Shakeel.

I just realized that I can use an event to send email without holding up the flow. Either use a event action or use gs.eventquequ()

Actuon for another time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants