Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

can we send an email from Cloud AEM servlet?

TB3dock
Level 8
Level 8

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.

1 Accepted Solution
BrianKasingli
Correct answer by
Community Advisor
Community Advisor

@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:

BrianKasingli_0-1626116876113.png

 

 

View solution in original post

0 Replies
BrianKasingli
Correct answer by
Community Advisor
Community Advisor

@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:

BrianKasingli_0-1626116876113.png

 

 

View solution in original post

TB3dock
Level 8
Level 8
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.
BrianKasingli
Community Advisor
Community Advisor
@TB3dock, you can hard code "bufString" with your HTML template string.