can we send an email from Cloud AEM servlet? | Community
Skip to main content
Level 8
July 12, 2021
Solved

can we send an email from Cloud AEM servlet?

  • July 12, 2021
  • 2 replies
  • 1906 views

We want to implement a simple survey for users on our AEM site (cloud version).  To submit this, we need to write a servlet which takes the params (rating, comment, username etc) and sends them as email for someone in our organisation to manually collate and report on.

Is there some sort of built in SMTP service, or do we need to integrate via standard JAVA API to something like mailchimp or silverpop?

We have also considered integrating with something like jira or airtable to send and collate data, but we will use email as a backup if this is not feasible.

This will not be used to send emails to users, thats done via ACM.  This is to send emails to our staff.

Ideally we don't want to use any sort of templates, as this adds complexity and dev time.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by BrianKasingli

@TB3doc, a Sling Servlet in AEM will satisfy all your requirements. Take this example below where it is an example of a servlet sending out an email from an AEM instance.

https://www.albinsblog.com/2014/12/sending-mail-through-java-api-with_17.html#.YOyOmhNKhQI

 

However, if you are working on a large-scale website, then I would recommend a micro-services architecture. With the micro-services architecture, this will not overtake AEM publisher resources, resulting in a more performant environment for serving content from AEM. With this strategy, you would only need to work on the AEM front-end, while the micro-services will take care of all the : silverpop api, air table, or any other third party API calls.

 

The micro-services architecture, enables scalability (verticle scaling), security, reliability, high performance, etc... You will also be able to re-use this endpoint for multiple devices and channels such as IOS/Android apps, Kiosks, desktop apps, etc...

example:

 

 

2 replies

BrianKasingli
Community Advisor and Adobe Champion
BrianKasingliCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
July 12, 2021

@TB3doc, a Sling Servlet in AEM will satisfy all your requirements. Take this example below where it is an example of a servlet sending out an email from an AEM instance.

https://www.albinsblog.com/2014/12/sending-mail-through-java-api-with_17.html#.YOyOmhNKhQI

 

However, if you are working on a large-scale website, then I would recommend a micro-services architecture. With the micro-services architecture, this will not overtake AEM publisher resources, resulting in a more performant environment for serving content from AEM. With this strategy, you would only need to work on the AEM front-end, while the micro-services will take care of all the : silverpop api, air table, or any other third party API calls.

 

The micro-services architecture, enables scalability (verticle scaling), security, reliability, high performance, etc... You will also be able to re-use this endpoint for multiple devices and channels such as IOS/Android apps, Kiosks, desktop apps, etc...

example:

 

 

TB3dockAuthor
Level 8
July 13, 2021
Thanks for the helpful reply. That link to the servlet example is good, but it uses a template file held on the file system. Cloud wont support this unfortunately.
arunpatidar
Community Advisor
Community Advisor
July 13, 2021