Send mail in a Composer

117 views
Skip to first unread message

asferion

unread,
Jun 3, 2013, 4:35:45 AM6/3/13
to zk-ui...@googlegroups.com
Could you tell me how sending an email in a zk Composer ?
I use the Mail plugin which works in a controller but doesn't work in a composer
Thanks you in advance

My code in the composer 

import grails.plugin.mail.MailService;
....
 void onClick_mailButton(Event e) { 
 //Envoi mail 
    sendMail { 
            to demandeInstance.email
            subject "Demande de compte GDA" 
            body "Votre demande de compte GDA pour l'association "+demandeInstance.libelle+" a bien été prise en compte, le Conseil général du Val d'Oise vous remercie" 
    } 
}

And the error message

No signature of method: vdo.extgda.demande.CreateComposer.sendMail() is applicable for argument types: (vdo.extgda.demande.CreateComposer$_onClick_mailButton_closure2) values: [vdo.extgda.demande.CreateComposer$_onClick_mailButton_closure2@149c510f]
Possible solutions: findAll()


chu...@gmail.com

unread,
Jun 6, 2013, 9:35:07 PM6/6/13
to zk-ui...@googlegroups.com
Hi asferion,
Here is my solution and it works:

class IndexComposer {
MailService mailService //declare a mailService

...}
and in the method:
void onClick_mailButton(Event e) { 
mailService.sendMail {
to "x...@163.com"
subject "Hello Bob"
body 'this is some text'
}
}

Hope it helps! Good luck!

在 2013年6月3日星期一UTC+8下午4时35分45秒,asferion写道:

asferion95

unread,
Jun 7, 2013, 6:08:33 AM6/7/13
to zk-ui...@googlegroups.com
Fine it works

Thanks a lot !


2013/6/7 <chu...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Grails ZK UI Plugin User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zk-ui-user+...@googlegroups.com.
To post to this group, send email to zk-ui...@googlegroups.com.
Visit this group at http://groups.google.com/group/zk-ui-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages