Permalink
Browse files

added the mail integration plugin, the contact form and the logo

  • Loading branch information...
1 parent a335f71 commit 6243e14c4631296345366357528562710f4abcf2 @jettro committed Jan 4, 2010
View
7 MyScheduling-grailsPlugins.iml
@@ -32,6 +32,11 @@
<sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/joda-time-0.5/src/groovy" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/joda-time-0.5/grails-app/taglib" isTestSource="false" />
</content>
+ <content url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/mail-0.9">
+ <sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/mail-0.9/src/groovy" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/mail-0.9/grails-app/services" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/mail-0.9/grails-app/taglib" isTestSource="false" />
+ </content>
<content url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/navigation-1.1">
<sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/navigation-1.1/grails-app/services" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/navigation-1.1/grails-app/taglib" isTestSource="false" />
@@ -53,12 +58,14 @@
<root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/tomcat-1.2.0/lib" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/grails-ui-1.2-SNAPSHOT/lib" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/db-util-0.4/lib" />
+ <root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/mail-0.9/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/db-util-0.4/lib" recursive="false" />
<jarDirectory url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/grails-ui-1.2-SNAPSHOT/lib" recursive="false" />
<jarDirectory url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/joda-time-0.5/lib" recursive="false" />
+ <jarDirectory url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/mail-0.9/lib" recursive="false" />
<jarDirectory url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/tomcat-1.2.0/lib" recursive="false" />
</library>
</orderEntry>
View
3 application.properties
@@ -1,5 +1,5 @@
#Grails Metadata file
-#Thu Dec 24 18:15:50 CET 2009
+#Sun Jan 03 08:18:48 CET 2010
app.grails.version=1.2.0
app.name=MyScheduling
app.servlet.version=2.4
@@ -9,6 +9,7 @@ plugins.db-util=0.4
plugins.grails-ui=1.2-SNAPSHOT
plugins.hibernate=1.2.0
plugins.joda-time=0.5
+plugins.mail=0.9
plugins.navigation=1.1
plugins.tomcat=1.2.0
plugins.yui=2.7.0.1
View
13 grails-app/conf/Config.groovy
@@ -64,6 +64,19 @@ environments {
}
+// mail configuration
+grails {
+ mail {
+ host = "smtp.gmail.com"
+ port = 465
+ username = System.getProperty("gmail.userid") + "@gmail.com"
+ password = System.getProperty("gmail.password")
+ props = ["mail.smtp.auth":"true",
+ "mail.smtp.socketFactory.port":"465",
+ "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
+ "mail.smtp.socketFactory.fallback":"false"]
+ }
+}
// log4j configuration
log4j = {
// Example of changing the log pattern for the default console
View
19 grails-app/controllers/nl/gridshore/scheduling/sitemenu/ContactController.groovy
@@ -1,6 +1,21 @@
package nl.gridshore.scheduling.sitemenu
class ContactController {
- static navigation = [group:'sitemenu',order:20]
- def index = { }
+ static navigation = [group: 'sitemenu', order: 20]
+ def index = {}
+
+ def mail = {
+ if (params.yourname) {
+ sendMail {
+ to "jettro@coenradie.com"
+ subject "Contact Form"
+ html g.render(template: "contactMailTemplate",
+ model:[remark:params.remark,yourname:params.yourname,yourmail:params.yourmail])
+ }
+ flash.message = "Thank you for your remark, will get back to you if desired!"
+ } else {
+ flash.error = "Could not send a message, no name!"
+ }
+ redirect (controller:"contact")
+ }
}
View
20 grails-app/views/contact/_contactMailTemplate.gsp
@@ -0,0 +1,20 @@
+<%@ page contentType="text/html" %>
+<html>
+<head>
+ <title>Welcome Aboard</title>
+ <style type="text/css">
+ body {
+ font-family: "Trebuchet MS"
+ }
+ </style>
+</head>
+<body>
+<h1>Howdy!</h1>
+<p>
+ We have a remark from : <strong>${yourname}</strong> with <strong>${yourmail}</strong>
+</p>
+<p>
+ ${remark}
+</p>
+</body>
+</html>
View
24 grails-app/views/contact/index.gsp
@@ -3,8 +3,30 @@
<head>
<title>Contact page</title>
<meta name="layout" content="main"/>
+ <style>
+ label {
+ display : block;
+ }
+ </style>
+
</head>
<body>
- This is the contact page
+ <p>You can send a mail using the contact form.</p>
+ <div class="yui-skin-sam">
+ <g:form action="mail" method="POST">
+ <div>
+ <label>Name : </label><g:textField id="yourname" name="yourname"/>
+ </div>
+ <div>
+ <label>Email : </label><g:textField id="yourmail" name="yourmail"/>
+ </div>
+ <div>
+ <label>Remark : </label><g:textArea id="remark" name="remark" cols="50" rows="10"/>
+ </div>
+ <div>
+ <g:submitButton name="Send"/>
+ </div>
+ </g:form>
+
</body>
</html>
View
2 grails-app/views/layouts/main.gsp
@@ -19,7 +19,7 @@
<div id="sitemenu">
<nav:render group="sitemenu"/>
</div>
- <div id="grailsLogo" class="logo"><a href="http://grails.org"><img src="${resource(dir: 'images', file: 'grails_logo.png')}" alt="Grails" border="0"/></a></div>
+ <div id="grailsLogo" class="logo"><a href="http://grails.org"><img src="${resource(dir: 'images', file: 'logo_myscheduling.png')}" alt="MyScheduling logo" border="0"/></a></div>
<div id="menu">
<nav:render group="tabs"/>
<nav:renderSubItems group="tabs"/>
View
BIN web-app/images/favicon.ico
Binary file not shown.
View
BIN web-app/images/logo_myscheduling.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6243e14

Please sign in to comment.