Menu

Post image 1
Post image 2
1 / 2
0

πŸ“Ž Send Joget Emails with File Attachments Using BeanShell

DEV Community: javaΒ·ExplorerΒ·3 days ago
#KxA8CMvm
#dev#appvariable#form#email#string#import
Reading 0:00
15s threshold

Overview Joget can send notification emails through its built-in email tool, but some projects need to call an external email API and include files uploaded or generated inside Joget. This pattern reads a Joget-managed file, converts it to Base64, builds a JSON payload, and sends it to an email API. The example below is sanitized with generic field IDs, form table names, API variables, and recipient logic. How It Works Resolve recipients from a Joget participant or direct email list. Read an uploaded/generated file using FileUtil.getFile. Validate the file extension before attaching it. Convert the file bytes to Base64. Send the email payload to an external API using HttpURLConnection. Close streams and disconnect the HTTP connection in inally. Where to Use in Joget Use this in Workflow Builder as a BeanShell Tool after a document is generated, a request is approved, or a certificate/report is ready to send.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More