Help with mailDoc() | Community
Skip to main content
Level 2
April 15, 2021
Solved

Help with mailDoc()

  • April 15, 2021
  • 4 replies
  • 1330 views

Hello all,

 

I am looking for assistance if anyone would be so kind. 

 

I have a dynamic PDF with 20 forms. I also have 20 checkboxes on the main page to display or hide any of the 20 forms. So if a user only wants forms #3, 7, 12 for example they would simply check off those forms. The rest will be hidden. Now I would like to place a button to attach only the visible forms to an email however I do not want the main page (the one with the checkboxes) included in the attachment. I know it is just a matter of showing or hiding the main page however I have tried hiding the main page in the button's click function but it will only hide the page after the email gets populated and the forms are attached despite placing the presence = "hidden" statement at the very top. My code is as follows:

 

main.presence = "hidden";

 

event.target.mailDoc({
bUI: false,
cTo: "blah.com",
cCC: "blahblah.com",
cSubject: "this is the subject",
cMsg: "this is the message"
});

 

I also tried to place the event.target.mailDoc() as a function in a variable and called it via a timeout method but that did not work.

 

Thank you for your help

 

Louis

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 Vijayalakshmi_S

Hi @labreclo,

Could you please raise this query in AEM Forms/Lifecycle category

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-forms/ct-p/adobe-experience-manager-forms-community

 

4 replies

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
April 28, 2021
Mayank_Gandhi
Adobe Employee
Adobe Employee
May 4, 2021

@labreclo Is this main a master page?

LabrecloAuthor
Level 2
May 4, 2021

@mayank_gandhi It is a subform placed on top of a master page

 

Mayank_Gandhi
Adobe Employee
Adobe Employee
May 5, 2021

@labreclo  Can you try something, try triggering a mail again manually after hiding and see if the mail is as per the requirement.