Dayalan Punniyamoorthy Blog

Monday, May 12, 2025

Automating Emails in Oracle Cloud EPM with Groovy Email Template!

 Sometimes you just need to let someone know what’s going on in your EPM application—maybe a process finished, a check failed, or you just want to send a heads-up. This Groovy business rule makes it easy by sending emails right from EPM, using just a few runtime prompts.



Let’s walk through how it works. You can call this template in another Calculation rule or a Pipeline gives you lots of flexibility rather than using the pipeline email feature. 

Step 1: Grab the User Inputs

The script starts by pulling in three values you enter when you run the rule:

  • Email_To – who you’re sending to (you can use multiple emails separated by commas)
  • Email_Subject – what the email is about
  • Enter_Email_Body – what the message says

Behind the scenes, it grabs these values like thStep 2: Validate Before We Go

Before sending, it checks: did you forget to fill anything in?is:


It also clean up the email list so it's nicely formatted— As email service prefers semicolons instead of commas between addresses.


Step 2: Validate Before We Go

Before sending, it checks: did you forget to fill anything in?


If anything’s blank, the script stops right there with a friendly error. No one likes getting halfway through and failing silently.

Step 3: Set the Connection

There’s a predefined connection called "URL" that this rule uses to talk to the Oracle REST API. You set this up in EPM under Connections.



Step 4: Build the Email

The actual message is packaged as a JSON string:


It wraps your message in a simple HTML layout so it looks clean in an inbox. It also adds a little note: “don’t reply to this, it’s just the system talking.”


Step 5: Fire Off the Email

Here's where it actually sends the message:


We’re using Oracle’s /mails/send REST endpoint to do the work.

Step 6: Check the Result

If the response comes back successful (status 200–299), great! If not, we stop the rule and show you what happened:



This is for debugging—especially if, say, the email address was wrong or the connection failed.

The complete rule is here,

This rule is for:

  • Alerting users when a validation fails
  • Letting finance teams know a forecast was submitted
  • Reminding folks of upcoming deadlines

And the best part? You don’t need to log into anything else—it's all triggered from your EPM form, a business rule or a Pipeline.

 Hope this is useful, Happy days on the Cloud!

No comments:

Post a Comment