Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8326665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:50:14+00:00 2026-06-09T00:50:14+00:00

In our application, numerous emails are being sent from the system. These emails were

  • 0

In our application, numerous emails are being sent from the system. These emails were of the same format for all users with different contextual variables populating the dynamic data.

We are now planning a feature to allow administrators to edit and customize these templates. As such the plan is to use the groovy shell to evaluate the templates at run time e.g.

Binding binding = new Binding();
binding.setVariable("model", [var1: "First Name", var2: "Last Name"])
GroovyShell shell = new GroovyShell(binding);

Object email = shell.evaluate('return "<html><title>Test Shell</title><body>${model.var1} ${model.var2}</body></html>";');

This seems to work adequately for us. The questions I have are:

  1. Is the GroovyShell the preferred engine to use or is Rhino or other better?
  2. Are there any performance concerns or memory issues to be aware of? Any low hanging fruit we can optimize i.e. can the shell or binding be reused
  3. What’s the biggest bottleneck in the above code? The construction? The evaluation?

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:50:16+00:00Added an answer on June 9, 2026 at 12:50 am

    I would recommend using something like GroovyPagesTemplateEngine because it goes beyond just Groovy eval and you and you can use all the grails taglib goodness as well. I’m using both GroovyPagesTemplateEngine and SimpleTemplateEngine for your exact scenario.

    SimpleTemplateEngine is slightly faster so if I don’t need much more than simple binding I use it. When I need to deal with logic and control structures, I use GroovyPagesTemplateEngine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have recently released version 1.0.0 of our application and have sent out numerous
Our application is getting a System Call Failed RPC error from DCOM ( 0x80010100
Our application is sending our emails with Word attachments using System.Net.Mail. We have empty-string
Our application depends on numerous resources that are provided by another system. To ensure
Our application takes text from a web form and sends it via email to
Our application downloads data from the internet using RSS but is having connection problems
Our application uses SQL Server Reporting Services and allows users to add custom filters
Our application allows users to upload javascript, CSS, and HTML files. We need a
our application (C++ + OpenGL + GLUT) runs OK on all Macs with 10.6.7
Our application is mining names from people using Twitter to login. Twitter is providing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.