Mail API

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Mail API

Chris Ward
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog 
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Mail API

Graeme Rocher-2
As per the docs, just don't use the service, use the injected method for controllers/services:




On Fri, Jun 21, 2013 at 5:01 PM, Chris Ward <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Graeme Rocher
Grails Project Lead
SpringSource
Reply | Threaded
Open this post in threaded view
|

Re: Mail API

Marc Palmer Local
In reply to this post by Chris Ward
100% agree. All such common functionality needs APIs that are not part if grails core.

In this case I think mail plugin should provide the Api and default impl but allow e.g. Send grid or others to override the impl bean.

*However* there's an argument in favour of this being a declared contract for Events rather than a interface.

--
Marc Palmer


> On 21 Jun 2013, at 16:01, Chris Ward <[hidden email]> wrote:
>
> I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!
>
> So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.
>
> The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.
>
> I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.
>
> Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?
>
> Chris Ward
> http://www.cyberward.net/blog 
> http://cwardphoto.com
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Mail API

lucastex
In reply to this post by Chris Ward

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Mail API

Chris Ward
Graeme,

Not sure I follow. I have it working using the sendGridService for code that I wrote, but I would like to be able to use other plugins that currently only use the Mail plugin. For example, the Email Confirmation plugin. It sends email using the Mail plugin using the mailService I believe, so they are currently incompatible, right?

Marc,

If the Mail plugin provides the default impl, how would another mail plugin override the impl bean?

If an event model were to be used, what would that look like? I looked at the code for the Email Confirmation plugin, and it uses the Platform Core plugin (same author I believe ;-) and it appears to be listening for an event upon which it sends an email using the Mail plugin. I admit I haven't played with Platform Core and the events it contributes, but would I was wondering if it would be more like how the spring security abstraction was done?

Lucas,

I am pretty green to the cloud. I had looked at a couple of providers so far, Cloud Foundary, and Cloud Bees (picked to use the jenkins build in development) and they don't have the ability to send email using SMTP. I foolishly figured all cloud providers were like that. I hadn't come across Mandril (MailChimp?) and it looks interresting, but right now, using  Cloud Bees won't let me use SMPT, hence the rest api that the SendGrid plugin wraps.

Chris

On Jun 22, 2013, at 12:53 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: Mail API

Sebastien Blanc
Just thinking aloud but couldn't you override the bean definition (mailService injected the impl you want) with Spring bean dsl builder on application level (resource.groovy) . This configuration will be loaded as last (if I remember well) and will override all the rest.
Seb

Envoyé de mon iPhone

Le Jun 22, 2013 à 20:46, Chris Ward <[hidden email]> a écrit :

Graeme,

Not sure I follow. I have it working using the sendGridService for code that I wrote, but I would like to be able to use other plugins that currently only use the Mail plugin. For example, the Email Confirmation plugin. It sends email using the Mail plugin using the mailService I believe, so they are currently incompatible, right?

Marc,

If the Mail plugin provides the default impl, how would another mail plugin override the impl bean?

If an event model were to be used, what would that look like? I looked at the code for the Email Confirmation plugin, and it uses the Platform Core plugin (same author I believe ;-) and it appears to be listening for an event upon which it sends an email using the Mail plugin. I admit I haven't played with Platform Core and the events it contributes, but would I was wondering if it would be more like how the spring security abstraction was done?

Lucas,

I am pretty green to the cloud. I had looked at a couple of providers so far, Cloud Foundary, and Cloud Bees (picked to use the jenkins build in development) and they don't have the ability to send email using SMTP. I foolishly figured all cloud providers were like that. I hadn't come across Mandril (MailChimp?) and it looks interresting, but right now, using  Cloud Bees won't let me use SMPT, hence the rest api that the SendGrid plugin wraps.

Chris

On Jun 22, 2013, at 12:53 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: Mail API

lucastex
In reply to this post by Chris Ward
We're using AWS for a long time. 

We've tried SendGrid, Mandrill (yeah, from the mailchimp group) and even AWS SES email service. 
All of them allow to use regular SMTP API that would work with grails mail plugin.

[]s, 



On Sat, Jun 22, 2013 at 3:46 PM, Chris Ward <[hidden email]> wrote:
Graeme,

Not sure I follow. I have it working using the sendGridService for code that I wrote, but I would like to be able to use other plugins that currently only use the Mail plugin. For example, the Email Confirmation plugin. It sends email using the Mail plugin using the mailService I believe, so they are currently incompatible, right?

Marc,

If the Mail plugin provides the default impl, how would another mail plugin override the impl bean?

If an event model were to be used, what would that look like? I looked at the code for the Email Confirmation plugin, and it uses the Platform Core plugin (same author I believe ;-) and it appears to be listening for an event upon which it sends an email using the Mail plugin. I admit I haven't played with Platform Core and the events it contributes, but would I was wondering if it would be more like how the spring security abstraction was done?

Lucas,

I am pretty green to the cloud. I had looked at a couple of providers so far, Cloud Foundary, and Cloud Bees (picked to use the jenkins build in development) and they don't have the ability to send email using SMTP. I foolishly figured all cloud providers were like that. I hadn't come across Mandril (MailChimp?) and it looks interresting, but right now, using  Cloud Bees won't let me use SMPT, hence the rest api that the SendGrid plugin wraps.

Chris

On Jun 22, 2013, at 12:53 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





Reply | Threaded
Open this post in threaded view
|

Re: Mail API

Chris Ward
I think you are missing the point that some cloud services such as Could Bees and Cloud Foundary have disabled the standard SMTP ports. While all of those services will work over SMTP, they also provide a rest like api for people to use as well. That is what the SendGrid plugin tries to provide. It is just not a drop in replacement.

Chris

On Jun 23, 2013, at 2:50 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

We're using AWS for a long time. 

We've tried SendGrid, Mandrill (yeah, from the mailchimp group) and even AWS SES email service. 
All of them allow to use regular SMTP API that would work with grails mail plugin.

[]s, 



On Sat, Jun 22, 2013 at 3:46 PM, Chris Ward <[hidden email]> wrote:
Graeme,

Not sure I follow. I have it working using the sendGridService for code that I wrote, but I would like to be able to use other plugins that currently only use the Mail plugin. For example, the Email Confirmation plugin. It sends email using the Mail plugin using the mailService I believe, so they are currently incompatible, right?

Marc,

If the Mail plugin provides the default impl, how would another mail plugin override the impl bean?

If an event model were to be used, what would that look like? I looked at the code for the Email Confirmation plugin, and it uses the Platform Core plugin (same author I believe ;-) and it appears to be listening for an event upon which it sends an email using the Mail plugin. I admit I haven't played with Platform Core and the events it contributes, but would I was wondering if it would be more like how the spring security abstraction was done?

Lucas,

I am pretty green to the cloud. I had looked at a couple of providers so far, Cloud Foundary, and Cloud Bees (picked to use the jenkins build in development) and they don't have the ability to send email using SMTP. I foolishly figured all cloud providers were like that. I hadn't come across Mandril (MailChimp?) and it looks interresting, but right now, using  Cloud Bees won't let me use SMPT, hence the rest api that the SendGrid plugin wraps.

Chris

On Jun 22, 2013, at 12:53 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email







Reply | Threaded
Open this post in threaded view
|

Re: Mail API

Graeme Rocher-2
Lucas' point is that the plugins implement javax.mail.* (which is the standard API for mail in Java and is independent of the SMTP protocol)


On Mon, Jun 24, 2013 at 1:46 AM, Chris Ward <[hidden email]> wrote:
I think you are missing the point that some cloud services such as Could Bees and Cloud Foundary have disabled the standard SMTP ports. While all of those services will work over SMTP, they also provide a rest like api for people to use as well. That is what the SendGrid plugin tries to provide. It is just not a drop in replacement.

Chris

On Jun 23, 2013, at 2:50 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

We're using AWS for a long time. 

We've tried SendGrid, Mandrill (yeah, from the mailchimp group) and even AWS SES email service. 
All of them allow to use regular SMTP API that would work with grails mail plugin.

[]s, 



On Sat, Jun 22, 2013 at 3:46 PM, Chris Ward <[hidden email]> wrote:
Graeme,

Not sure I follow. I have it working using the sendGridService for code that I wrote, but I would like to be able to use other plugins that currently only use the Mail plugin. For example, the Email Confirmation plugin. It sends email using the Mail plugin using the mailService I believe, so they are currently incompatible, right?

Marc,

If the Mail plugin provides the default impl, how would another mail plugin override the impl bean?

If an event model were to be used, what would that look like? I looked at the code for the Email Confirmation plugin, and it uses the Platform Core plugin (same author I believe ;-) and it appears to be listening for an event upon which it sends an email using the Mail plugin. I admit I haven't played with Platform Core and the events it contributes, but would I was wondering if it would be more like how the spring security abstraction was done?

Lucas,

I am pretty green to the cloud. I had looked at a couple of providers so far, Cloud Foundary, and Cloud Bees (picked to use the jenkins build in development) and they don't have the ability to send email using SMTP. I foolishly figured all cloud providers were like that. I hadn't come across Mandril (MailChimp?) and it looks interresting, but right now, using  Cloud Bees won't let me use SMPT, hence the rest api that the SendGrid plugin wraps.

Chris

On Jun 22, 2013, at 12:53 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email










--
Graeme Rocher
Grails Project Lead
SpringSource
Reply | Threaded
Open this post in threaded view
|

Re: Mail API

Eamonn O'Connell-2
Chris, 

As other's have said, if the APIs are the same, you should be able to associate the mailService with a class from the sendGrid plugin. Probably the best place for this to happen would be in the SendGrid plugin itself (PR?), but doing it your app in resources.groovy should work too.

Best,
Eamonn



On 24 June 2013 08:34, Graeme Rocher <[hidden email]> wrote:
Lucas' point is that the plugins implement javax.mail.* (which is the standard API for mail in Java and is independent of the SMTP protocol)


On Mon, Jun 24, 2013 at 1:46 AM, Chris Ward <[hidden email]> wrote:
I think you are missing the point that some cloud services such as Could Bees and Cloud Foundary have disabled the standard SMTP ports. While all of those services will work over SMTP, they also provide a rest like api for people to use as well. That is what the SendGrid plugin tries to provide. It is just not a drop in replacement.

Chris

On Jun 23, 2013, at 2:50 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

We're using AWS for a long time. 

We've tried SendGrid, Mandrill (yeah, from the mailchimp group) and even AWS SES email service. 
All of them allow to use regular SMTP API that would work with grails mail plugin.

[]s, 



On Sat, Jun 22, 2013 at 3:46 PM, Chris Ward <[hidden email]> wrote:
Graeme,

Not sure I follow. I have it working using the sendGridService for code that I wrote, but I would like to be able to use other plugins that currently only use the Mail plugin. For example, the Email Confirmation plugin. It sends email using the Mail plugin using the mailService I believe, so they are currently incompatible, right?

Marc,

If the Mail plugin provides the default impl, how would another mail plugin override the impl bean?

If an event model were to be used, what would that look like? I looked at the code for the Email Confirmation plugin, and it uses the Platform Core plugin (same author I believe ;-) and it appears to be listening for an event upon which it sends an email using the Mail plugin. I admit I haven't played with Platform Core and the events it contributes, but would I was wondering if it would be more like how the spring security abstraction was done?

Lucas,

I am pretty green to the cloud. I had looked at a couple of providers so far, Cloud Foundary, and Cloud Bees (picked to use the jenkins build in development) and they don't have the ability to send email using SMTP. I foolishly figured all cloud providers were like that. I hadn't come across Mandril (MailChimp?) and it looks interresting, but right now, using  Cloud Bees won't let me use SMPT, hence the rest api that the SendGrid plugin wraps.

Chris

On Jun 22, 2013, at 12:53 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email










--
Graeme Rocher
Grails Project Lead
SpringSource

Reply | Threaded
Open this post in threaded view
|

Re: Mail API

wavyx
Hi,

maybe check the asynchronous mail plugin wich seems to be able to override the "mailService"

++
Eric



On Mon, Jun 24, 2013 at 10:26 AM, Eamonn O'Connell <[hidden email]> wrote:
Chris, 

As other's have said, if the APIs are the same, you should be able to associate the mailService with a class from the sendGrid plugin. Probably the best place for this to happen would be in the SendGrid plugin itself (PR?), but doing it your app in resources.groovy should work too.

Best,
Eamonn



On 24 June 2013 08:34, Graeme Rocher <[hidden email]> wrote:
Lucas' point is that the plugins implement javax.mail.* (which is the standard API for mail in Java and is independent of the SMTP protocol)


On Mon, Jun 24, 2013 at 1:46 AM, Chris Ward <[hidden email]> wrote:
I think you are missing the point that some cloud services such as Could Bees and Cloud Foundary have disabled the standard SMTP ports. While all of those services will work over SMTP, they also provide a rest like api for people to use as well. That is what the SendGrid plugin tries to provide. It is just not a drop in replacement.

Chris

On Jun 23, 2013, at 2:50 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

We're using AWS for a long time. 

We've tried SendGrid, Mandrill (yeah, from the mailchimp group) and even AWS SES email service. 
All of them allow to use regular SMTP API that would work with grails mail plugin.

[]s, 



On Sat, Jun 22, 2013 at 3:46 PM, Chris Ward <[hidden email]> wrote:
Graeme,

Not sure I follow. I have it working using the sendGridService for code that I wrote, but I would like to be able to use other plugins that currently only use the Mail plugin. For example, the Email Confirmation plugin. It sends email using the Mail plugin using the mailService I believe, so they are currently incompatible, right?

Marc,

If the Mail plugin provides the default impl, how would another mail plugin override the impl bean?

If an event model were to be used, what would that look like? I looked at the code for the Email Confirmation plugin, and it uses the Platform Core plugin (same author I believe ;-) and it appears to be listening for an event upon which it sends an email using the Mail plugin. I admit I haven't played with Platform Core and the events it contributes, but would I was wondering if it would be more like how the spring security abstraction was done?

Lucas,

I am pretty green to the cloud. I had looked at a couple of providers so far, Cloud Foundary, and Cloud Bees (picked to use the jenkins build in development) and they don't have the ability to send email using SMTP. I foolishly figured all cloud providers were like that. I hadn't come across Mandril (MailChimp?) and it looks interresting, but right now, using  Cloud Bees won't let me use SMPT, hence the rest api that the SendGrid plugin wraps.

Chris

On Jun 22, 2013, at 12:53 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email










--
Graeme Rocher
Grails Project Lead
SpringSource


Reply | Threaded
Open this post in threaded view
|

Re: Mail API

lucastex
In reply to this post by Graeme Rocher-2
Graeme and Chris,

Yeah, I've missed that point in the very first email.

Chris, you can try either the AWS Plugin I've wrote, to use the AWS SES functionality, it will send mails using AWS infrastructure, and it won't rely on SMTP protocols, but will send over AWS HTTP API.

I personally am not using it, but I've used for a long time before and worked great.

Sorry the first misunderstood.

[]s,

Lucas



On Mon, Jun 24, 2013 at 3:34 AM, Graeme Rocher <[hidden email]> wrote:
Lucas' point is that the plugins implement javax.mail.* (which is the standard API for mail in Java and is independent of the SMTP protocol)


On Mon, Jun 24, 2013 at 1:46 AM, Chris Ward <[hidden email]> wrote:
I think you are missing the point that some cloud services such as Could Bees and Cloud Foundary have disabled the standard SMTP ports. While all of those services will work over SMTP, they also provide a rest like api for people to use as well. That is what the SendGrid plugin tries to provide. It is just not a drop in replacement.

Chris

On Jun 23, 2013, at 2:50 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

We're using AWS for a long time. 

We've tried SendGrid, Mandrill (yeah, from the mailchimp group) and even AWS SES email service. 
All of them allow to use regular SMTP API that would work with grails mail plugin.

[]s, 



On Sat, Jun 22, 2013 at 3:46 PM, Chris Ward <[hidden email]> wrote:
Graeme,

Not sure I follow. I have it working using the sendGridService for code that I wrote, but I would like to be able to use other plugins that currently only use the Mail plugin. For example, the Email Confirmation plugin. It sends email using the Mail plugin using the mailService I believe, so they are currently incompatible, right?

Marc,

If the Mail plugin provides the default impl, how would another mail plugin override the impl bean?

If an event model were to be used, what would that look like? I looked at the code for the Email Confirmation plugin, and it uses the Platform Core plugin (same author I believe ;-) and it appears to be listening for an event upon which it sends an email using the Mail plugin. I admit I haven't played with Platform Core and the events it contributes, but would I was wondering if it would be more like how the spring security abstraction was done?

Lucas,

I am pretty green to the cloud. I had looked at a couple of providers so far, Cloud Foundary, and Cloud Bees (picked to use the jenkins build in development) and they don't have the ability to send email using SMTP. I foolishly figured all cloud providers were like that. I hadn't come across Mandril (MailChimp?) and it looks interresting, but right now, using  Cloud Bees won't let me use SMPT, hence the rest api that the SendGrid plugin wraps.

Chris

On Jun 22, 2013, at 12:53 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email










--
Graeme Rocher
Grails Project Lead
SpringSource

Reply | Threaded
Open this post in threaded view
|

Re: Mail API

Chris Ward
Ok, thanks everybody. I will try just overriding the sendMail service for now. I have been swamped with other things, but will try soon.

Thanks,
Chris

On Jun 24, 2013, at 6:17 AM, Lucas F. A. Teixeira <[hidden email]> wrote:

Graeme and Chris,

Yeah, I've missed that point in the very first email.

Chris, you can try either the AWS Plugin I've wrote, to use the AWS SES functionality, it will send mails using AWS infrastructure, and it won't rely on SMTP protocols, but will send over AWS HTTP API.

I personally am not using it, but I've used for a long time before and worked great.

Sorry the first misunderstood.

[]s,

Lucas



On Mon, Jun 24, 2013 at 3:34 AM, Graeme Rocher <[hidden email]> wrote:
Lucas' point is that the plugins implement javax.mail.* (which is the standard API for mail in Java and is independent of the SMTP protocol)


On Mon, Jun 24, 2013 at 1:46 AM, Chris Ward <[hidden email]> wrote:
I think you are missing the point that some cloud services such as Could Bees and Cloud Foundary have disabled the standard SMTP ports. While all of those services will work over SMTP, they also provide a rest like api for people to use as well. That is what the SendGrid plugin tries to provide. It is just not a drop in replacement.

Chris

On Jun 23, 2013, at 2:50 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

We're using AWS for a long time. 

We've tried SendGrid, Mandrill (yeah, from the mailchimp group) and even AWS SES email service. 
All of them allow to use regular SMTP API that would work with grails mail plugin.

[]s, 



On Sat, Jun 22, 2013 at 3:46 PM, Chris Ward <[hidden email]> wrote:
Graeme,

Not sure I follow. I have it working using the sendGridService for code that I wrote, but I would like to be able to use other plugins that currently only use the Mail plugin. For example, the Email Confirmation plugin. It sends email using the Mail plugin using the mailService I believe, so they are currently incompatible, right?

Marc,

If the Mail plugin provides the default impl, how would another mail plugin override the impl bean?

If an event model were to be used, what would that look like? I looked at the code for the Email Confirmation plugin, and it uses the Platform Core plugin (same author I believe ;-) and it appears to be listening for an event upon which it sends an email using the Mail plugin. I admit I haven't played with Platform Core and the events it contributes, but would I was wondering if it would be more like how the spring security abstraction was done?

Lucas,

I am pretty green to the cloud. I had looked at a couple of providers so far, Cloud Foundary, and Cloud Bees (picked to use the jenkins build in development) and they don't have the ability to send email using SMTP. I foolishly figured all cloud providers were like that. I hadn't come across Mandril (MailChimp?) and it looks interresting, but right now, using  Cloud Bees won't let me use SMPT, hence the rest api that the SendGrid plugin wraps.

Chris

On Jun 22, 2013, at 12:53 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email










--
Graeme Rocher
Grails Project Lead
SpringSource



Reply | Threaded
Open this post in threaded view
|

Re: Mail API

Chris Ward
If anyone is following along, I did figure out how to get the SendGridService to replace the MailService from the usual Mail plugin. This works because the SendGrid author has much of the same functionality implemented as the Mail api. (not all, but the sendMail method is pretty well covered) I only have the SendGrid plugin installed.

In my spring/resources.groovy :

beans = {
springConfig.addAlias('mailService', 'sendGridService')
}

I got this from Bert's Programming Grails by the way.

Then in a service you can get the sendGridService injected as mailService with:

def mailService

...and you (or a plugin that is using the mailService to send an email) can do mailService.sendMail { ..... }

I haven't had a chance to try this with plugins yet, but it should work.

Chris

On Jun 24, 2013, at 7:00 AM, Chris Ward <[hidden email]> wrote:

Ok, thanks everybody. I will try just overriding the sendMail service for now. I have been swamped with other things, but will try soon.

Thanks,
Chris

On Jun 24, 2013, at 6:17 AM, Lucas F. A. Teixeira <[hidden email]> wrote:

Graeme and Chris,

Yeah, I've missed that point in the very first email.

Chris, you can try either the AWS Plugin I've wrote, to use the AWS SES functionality, it will send mails using AWS infrastructure, and it won't rely on SMTP protocols, but will send over AWS HTTP API.

I personally am not using it, but I've used for a long time before and worked great.

Sorry the first misunderstood.

[]s,

Lucas



On Mon, Jun 24, 2013 at 3:34 AM, Graeme Rocher <[hidden email]> wrote:
Lucas' point is that the plugins implement javax.mail.* (which is the standard API for mail in Java and is independent of the SMTP protocol)


On Mon, Jun 24, 2013 at 1:46 AM, Chris Ward <[hidden email]> wrote:
I think you are missing the point that some cloud services such as Could Bees and Cloud Foundary have disabled the standard SMTP ports. While all of those services will work over SMTP, they also provide a rest like api for people to use as well. That is what the SendGrid plugin tries to provide. It is just not a drop in replacement.

Chris

On Jun 23, 2013, at 2:50 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

We're using AWS for a long time. 

We've tried SendGrid, Mandrill (yeah, from the mailchimp group) and even AWS SES email service. 
All of them allow to use regular SMTP API that would work with grails mail plugin.

[]s, 



On Sat, Jun 22, 2013 at 3:46 PM, Chris Ward <[hidden email]> wrote:
Graeme,

Not sure I follow. I have it working using the sendGridService for code that I wrote, but I would like to be able to use other plugins that currently only use the Mail plugin. For example, the Email Confirmation plugin. It sends email using the Mail plugin using the mailService I believe, so they are currently incompatible, right?

Marc,

If the Mail plugin provides the default impl, how would another mail plugin override the impl bean?

If an event model were to be used, what would that look like? I looked at the code for the Email Confirmation plugin, and it uses the Platform Core plugin (same author I believe ;-) and it appears to be listening for an event upon which it sends an email using the Mail plugin. I admit I haven't played with Platform Core and the events it contributes, but would I was wondering if it would be more like how the spring security abstraction was done?

Lucas,

I am pretty green to the cloud. I had looked at a couple of providers so far, Cloud Foundary, and Cloud Bees (picked to use the jenkins build in development) and they don't have the ability to send email using SMTP. I foolishly figured all cloud providers were like that. I hadn't come across Mandril (MailChimp?) and it looks interresting, but right now, using  Cloud Bees won't let me use SMPT, hence the rest api that the SendGrid plugin wraps.

Chris

On Jun 22, 2013, at 12:53 PM, "Lucas F. A. Teixeira" <[hidden email]> wrote:

Just didn't understood why you can't use the regular SMTP approach. We're heavely cloud-based deployed and using SMTP approach with Mandrill (we've used AWS SES before)

Lucas

On Jun 22, 2013 9:30 AM, "Chris Ward" <[hidden email]> wrote:
I've been working on a grails app that will be deployed in a cloud environment. As my first cloud app I was surprised to find out you couldn't send email in a traditional SMTP way!

So. I removed the Mail plugin and tried the SendGrid plugin. This works fine, as long as I write all the code that interacts with email. The issue comes when I try to use another plugin that has mailing functionality. They depend on the Mail plugin.

The Mail and SendGrid plugins both support the sendMail method in controllers, but they have different service names (and maybe method signatures). It seems to me that having a consistent API for mail that plugin authors could code to would allow users to drop in their own mail service provider.

I have looked a bit at the platform core plugin, and I don't think this functionality is there yet. It feels like this could be a good place to implement this.

Any thoughts on this idea, or anyone have suggestions or other ways they use an alternate mail plugin with their app?

Chris Ward
http://www.cyberward.net/blog
http://cwardphoto.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email










--
Graeme Rocher
Grails Project Lead
SpringSource