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

AEM 6.3 Forms - How to email-attach a generated PDF on submit

Avatar

Avatar
Validate 1
Level 2
fabioper85
Level 2

Likes

5 likes

Total Posts

33 posts

Correct Reply

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

Avatar
Validate 1
Level 2
fabioper85
Level 2

Likes

5 likes

Total Posts

33 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
fabioper85
Level 2

11-09-2018

Hi everyone

I'm trying to solve this puzzle, but I can't get it!

I created an Adaptive Form from an XSD schema and I render as PDF through an XDP

Now, on submit, I want to store the generated pdf and also send it via mail as attachment

I followed the steps in this link

AEM 6.0 Forms Help | Writing custom Submit action for adaptive forms

Everything works, I only need to attach the generated file

I know that I have to use a MultiPartEmail, but I'm missing the remaining steps

Can someone help me?

Thanks a lot

Fabio

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

11-09-2018

Are you using AEM Forms for J2EE for AEM Forms for OSGi?

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

11-09-2018

If you can render the AF in HTML, you may utilise the DOR option to obtain the data and leverage OOTB email submit action/Form Portal store as well.

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

11-09-2018

Adding more to the suggestion. I have created 'test_fabio' as a sample form

1. Create an AF based on the XDP.

1569666_pastedImage_0.png

2. Bind the fields as required. 

1569667_pastedImage_1.png

3. Select the submit action to send PDF via email. For this configure the Day CQ Mail Service beforehand. The field names in an adaptive form are called placeholders that are replaced with the value of that field after a user submits the form. To define a placeholder, specify ${<field name>} in the respective field for ex ${email_addr} in the 'To' field.

1569671_pastedImage_2.png

Result:

1569672_pastedImage_3.png

The XDP template would be sent as PDF with the value populated from the bound fields.

1569673_pastedImage_6.png

Avatar

Avatar
Validate 1
Level 2
fabioper85
Level 2

Likes

5 likes

Total Posts

33 posts

Correct Reply

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

Avatar
Validate 1
Level 2
fabioper85
Level 2

Likes

5 likes

Total Posts

33 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
fabioper85
Level 2

11-09-2018

Thank you everyon for the answers, guys

I really appreciate!!

I have a question: the OOTB email send doesn't store the resulting PDF, right?

because I need also to store the pdf

thanks

Fabio

Avatar

Avatar
Validate 1
Level 2
fabioper85
Level 2

Likes

5 likes

Total Posts

33 posts

Correct Reply

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

Avatar
Validate 1
Level 2
fabioper85
Level 2

Likes

5 likes

Total Posts

33 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
fabioper85
Level 2

12-09-2018

Hi smacdonald2008

We use AEM 6.3 Forms JEE

Avatar

Avatar
Validate 1
Level 2
fabioper85
Level 2

Likes

5 likes

Total Posts

33 posts

Correct Reply

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

Avatar
Validate 1
Level 2
fabioper85
Level 2

Likes

5 likes

Total Posts

33 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
fabioper85
Level 2

12-09-2018

sorry guyz, maybe I wasn't too clear with my question...my fault

try to be more specific

What do I mean by "store"?

We'd like to blend the Store PDF submissionType and the Send PDF via mail

in one SubmissionType

Nowaday...we can run the 2 actions separately, we need to connect

Maybe we need to create a Worflow???

Sorry for the (maybe) stupid questions... 😞

You guyz are great!

Fabio

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

12-09-2018

Fabio,

You would need to create workflow here to perform both the steps. Not possible OOTB.

On the other hand, if you can store data in DB just submit the form to JEE workflow and let JEE process handle the form save and email action. This is in case you find Aem workflow challenging. Here you can use Jdbc service and Mail component provided in workbench to handle the AF data.