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

'org.apache.commons.mail.EmailException: Invalid message supplied' while trying to send email through ACS commons EmailService

Avatar

Level 1
acsCommonsEmailService.sendEmail("/etc/notification/email/sample.html",emailParams,"samplemail@mail.com");

and i'm getting below Error-

 

*ERROR* [JobHandler: /var/workflow/instances/server0/2020-04-17/request_for_activation_197:/content/amzn-biz/us/en/discover-more/events] com.adobe.acs.commons.email.impl.EmailServiceImpl Error sending email to [ nmuddana@deloitte.com ]
org.apache.commons.mail.EmailException: Invalid message supplied
at org.apache.commons.mail.HtmlEmail.setMsg(HtmlEmail.java:177) [org.apache.commons.email:1.5.0]
at com.day.cq.commons.mail.MailTemplate.getEmail(MailTemplate.java:181) [com.day.cq.cq-commons:5.12.16]
at com.adobe.acs.commons.email.impl.EmailServiceImpl.getEmail(EmailServiceImpl.java:234) [com.adobe.acs.acs-aem-commons-bundle:4.3.0]
at com.adobe.acs.commons.email.impl.EmailServiceImpl.sendEmail(EmailServiceImpl.java:152) [com.adobe.acs.acs-aem-commons-bundle:4.3.0]
at com.adobe.acs.commons.email.impl.EmailServiceImpl.sendEmail(EmailServiceImpl.java:125) [com.adobe.acs.acs-aem-commons-bundle:4.3.0]
at com.amazon.business.core.services.impl.EmailServiceImpl.sendNotification(EmailServiceImpl.java:162)
at com.amazon.business.core.workflows.ContentApproverSelectionStep.getParticipant(ContentApproverSelectionStep.java:139)
at com.adobe.granite.workflow.core.advance.DynamicParticipantNodeHandler.getParticipant(DynamicParticipantNodeHandler.java:206) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0002]
at com.adobe.granite.workflow.core.advance.ParticipantNodeHandler.doTransition(ParticipantNodeHandler.java:185) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0002]
at com.adobe.granite.workflow.core.advance.ParticipantNodeHandler.doTransition(ParticipantNodeHandler.java:134) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0002]
at com.adobe.granite.workflow.core.advance.OrSplitNodeHandler.doTransition(OrSplitNodeHandler.java:126) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0002]
at com.adobe.granite.workflow.core.advance.AdvanceUtil.transitionFrom(AdvanceUtil.java:126) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0002]
at com.adobe.granite.workflow.core.WorkflowSessionImpl.completeInternal(WorkflowSessionImpl.java:1050) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0002]
at com.adobe.granite.workflow.core.WorkflowSessionImpl.complete(WorkflowSessionImpl.java:1020) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0002]
at com.amazon.business.core.workflows.DelegateWorkflowProcess.execute(DelegateWorkflowProcess.java:124)
at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:195) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0002]
at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:260) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0002]
at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:502) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:293) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:60) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:229) [org.apache.sling.event:4.2.12]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

 

and , i have 'acs-commons-email-service' user configured with /etc/notification/email read permission.

i'm not understanding what i'm missing here 

1 Reply

Avatar

Employee

Please check this https://adobe-consulting-services.github.io/acs-aem-commons/features/e-mail/email-api/index.html and make sure that the template has the file ending ".html" as described in the documentation. Also it seems that you are missing the email headers: _ From_, Subject followed by an empty line.