Plugins You can find out about all the publicly available Grails plugins.

Contact Me

  • Tags: contact, email
  • Latest: 0.2.1
  • Last Updated: 14 August 2009
  • Grails version: 1.1 >*
  • Authors: null
1 vote
compile "org.grails.plugins:contact-me:0.2.1"




grails install-plugin contact-me


Provides a simple AJAX contact me form. Uses the mail plugin to send a email based on form entries. A simple captcha challenge is used to validate the user.

Configuration options (in Config.groovy)

  • The destination email address (required)
  • An alternative view to use to format the email
  • contactme.form.view: An alternative view for the contact form
  • contactme.thanks.view: An alternative view after the email is sent
The contact-me plugin uses the form-helper plugin to make styling easier. If you need additional information on the <form:xxx> tags, see the form-helper plugin

If you place additional fields in the contact form, those are available in the params variable to all other views

Configuration options for the Mail Plugin also apply.

Here is the default view

<%@ page contentType="text/plain"%>
You have a contact-me email

from: ${} at: ${} subject: ${contactForm.subject}





Displays the contact me form


Used in the form to place the captcha challenge question



You can perform some action after the mail is sent using properties from the form used by the contactMe controller.

To do this simply define a 'afterContactMe' closure in any artefact class. Here is an example that writes a log entry after a email is sent.

class MailLog {

Date dateCreated String name String email String subject String message

static afterContactMe = { form, params -> new MailLog(,, subject:form.subject, message:form.message).save() } }

Here is the definition of the mail form command class (can be found in ContactMeController):

class ContactForm {
    String name
    String email
    String subject
    String message
    String captcha

static constraints = { name(blank: false) email(blank: false, email: true) subject(blank: false) message(blank: false) } }

Future enhancements

  • Image based captcha
To see this plugin in action, go to:

For any enhancements or questions, please feel free to contact me at scott at bulldoginfo dot com