Permalink
Browse files

Update Readme.md

  • Loading branch information...
1 parent 7fe7d67 commit 0a6773e47a0acad5d61ab8d9660b0e869823f76b @serty2 serty2 committed Sep 27, 2012
Showing with 54 additions and 0 deletions.
  1. +54 −0 Readme.md
View
@@ -13,6 +13,60 @@ It curently handles :
* [Send](https://mandrillapp.com/api/docs/messages.html#method=send)
+Installation
+-------
+
+Upon install, this plugin adds a section to your Config.groovy file
+
+ mandrill {
+ apiKey = ""
+ // insert proxy values if needed
+ //proxy {
+ // host = ""
+ // The port Value has to be an integer ;)
+ // port = ""
+ //}
+ }
+
+You need to fill in the apiKey parameter with the REST api KEY that you get with your [mandrill account](http://www.mandrill.com)
+
Usage
-------
+Inject MandrillService into your services or controllers :
+
+ def mandrillService
+
+### Ping
+
+To call the ping method just type :
+
+ def ret = mandrillService.ping()
+
+ret should contain "PONG!"
+
+### Info
+
+To call the ping method just type :
+
+ def ret = mandrillService.info()
+
+ret should contain a JSON array with the infos associated to your mandrill API Key
+
+
+### Send
+
+To send a mail :
+
+ def recpts = []
+ recpts.add(new MandrillRecipient(name:"foo", email:"foo@bar.com"))
+ recpts.add(new MandrillRecipient(name:"bar", email:"bar@foo.com"))
+ def message = new MandrillMessage(
+ text:"this is a text message",
+ subject:"this is a subject",
+ from_email:"thisisatest@yopmail.com",
+ to:recpts)
+ message.tags.add("test")
+ def ret = mandrillService.send(message)
+
+ret should contain a JSON array with success information or error information

0 comments on commit 0a6773e

Please sign in to comment.