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
BedrockMission!

Learn More

View all

Sign in to view all badges

Get file attachment path to use in JSP to send email with attachment?

Avatar

Avatar
Validate 1
Level 2
Phoenix_uy
Level 2

Likes

3 likes

Total Posts

19 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Phoenix_uy
Level 2

Likes

3 likes

Total Posts

19 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
Phoenix_uy
Level 2

26-10-2015

I'm kind new in AEM and Adaptive Forms and i'm making a custom action for a form. 

My problem is that i don't know how to get the information from a file attachment component to use in my JSP code to send an email.

This is part of the code that i have right now:

    

ValueMap props = ResourceUtil.getValueMap(resource); HtmlEmail email = new HtmlEmail(); String[] mailTo = props.get("mailto", new String[0]); email.setFrom((String)props.get("from")); for (String toAddr : mailTo) { email.addTo(toAddr); } //EmailAttachment attachment = new EmailAttachment(); //What do i need to do from here to set the attachment? email.setHtmlMsg((String)props.get("template")); email.setSubject((String)props.get("subject")); MessageGatewayService messageGatewayService = sling.getService(MessageGatewayService.class); MessageGateway messageGateway = messageGatewayService.getGateway(HtmlEmail.class); messageGateway.send(email);

Accepted Solutions (0)

Answers (0)