Mail Plugin 0.9 to 1.x feature or bug?

classic Classic list List threaded Threaded
3 messages Options
nos
Reply | Threaded
Open this post in threaded view
|

Mail Plugin 0.9 to 1.x feature or bug?

nos
I am using the mail plugin version 0.9. I've written some integration tests to test the MailMessage returned from mailService.sendMessage. When I upgraded to the latest and greatest version of the mail plugin (1.0.1 I think....) I've noticed that in my test the MailMessage no longer gets returned. The reason for this is (on an initial investigation) is that in my Config.groovy I've the property 'grails.mail.disabled' set to 'true'  for DEV and TEST (for self protection...). I find it handy to test the cc,bcc, attachments etc...and it worked in the 0.9 plugin.

But the question is, is this a bug or a feature? If it's a bug I'll wait for the fix, if it's a feature then I need to re-adjust my test.

Thanks!


Here is how I got the MailMessage message with 0.9:


  MailMessage mm = mailService.sendMail {

            if (StringUtils.isNotBlank(mailToSend.fromEmailAddress)) from mailToSend.fromEmailAddress;
            if (StringUtils.isNotBlank(mailToSend.toEmailAddress)) to mailToSend.toEmailAddress;
            ...........

   }

 return mm;
Reply | Threaded
Open this post in threaded view
|

Re: Mail Plugin 0.9 to 1.x feature or bug?

Nathan Wells

I'd say that's expected behavior. Have you tried using the greenmail plugin? It should work great for you.

On Dec 18, 2012 2:41 AM, "nos" <[hidden email]> wrote:
I am using the mail plugin version 0.9. I've written some integration tests
to test the MailMessage returned from mailService.sendMessage. When I
upgraded to the latest and greatest version of the mail plugin (1.0.1 I
think....) I've noticed that in my test the MailMessage no longer gets
returned. The reason for this is (on an initial investigation) is that in my
Config.groovy I've the property 'grails.mail.disabled' set to 'true'  for
DEV and TEST (for self protection...). I find it handy to test the cc,bcc,
attachments etc...and it worked in the 0.9 plugin.

But the question is, is this a bug or a feature? If it's a bug I'll wait for
the fix, if it's a feature then I need to re-adjust my test.

Thanks!


Here is how I got the MailMessage message with 0.9:


  MailMessage mm = mailService.sendMail {

            if (StringUtils.isNotBlank(mailToSend.fromEmailAddress)) from
mailToSend.fromEmailAddress;
            if (StringUtils.isNotBlank(mailToSend.toEmailAddress)) to
mailToSend.toEmailAddress;
            ...........

   }

 return mm;



--
View this message in context: http://grails.1312388.n4.nabble.com/Mail-Plugin-0-9-to-1-x-feature-or-bug-tp4639196.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


nos
Reply | Threaded
Open this post in threaded view
|

Re: Mail Plugin 0.9 to 1.x feature or bug?

nos
I agree, it's expected behavior, it's just different in the 0.9 mail plugin. I will use the greenmail plugin and this way I can enable mail sending so my test should pass and I can upgrade the plugin.

Thanks.