How to create a custom submit action similar to the OOTB Send email action? | Community
Skip to main content
Level 2
April 23, 2024
Question

How to create a custom submit action similar to the OOTB Send email action?

  • April 23, 2024
  • 1 reply
  • 622 views

AEM 6.5.19 with AEM Forms installed.

I'm working on creating a custom submit action for forms so that I can decide if a form's email should go to email1 or email2 based on a form value.  It should just be a copy of the OOTB Send email submit action with a small bit of custom code added.  I've been working from ⁠this example, but it doesn't provide many answers.

It doesn't add any file attachments or run any token replacement for the subject and template.  I'd like to just extend the Send email action so I don't miss out on any of that functionality.  Any way I could do that?

I looked at /libs/fd/af/components/guidesubmittype/email/post.POST.jsp, but that seems to encapsulate all it's code inside "af.mail.jsp".  

 

GuideSubmitUtils.setForwardPath(slingRequest, resource.getPath(), "af.mail.jsp", null);

 

Where would I find "af.mail.jsp" so I could take a look at it?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Vijay_Kumar_Jalagari
Adobe Employee
Adobe Employee
April 24, 2024

 

Are email1 and email2 part of form definition?

 

You can use AEM workflow for writting business logic to use email1 or email2 instead of custom function.

 

 

dpkhmhsAuthor
Level 2
April 24, 2024

email1 and email2 are fields I added to my custom submit action.  They are NOT defined in the Adaptive Form for the end user to fill out.