Displaying API Response on Second Page in AMP Mailer After Form Submission | Community
Skip to main content
Level 2
June 25, 2024
Solved

Displaying API Response on Second Page in AMP Mailer After Form Submission

  • June 25, 2024
  • 1 reply
  • 905 views

Hi everyone,

 

I'm working on an AMP mailer that allows customers to fill out a form. After they submit the form, I need to:

a) Collect the form data.
b) Call an external API using the collected parameters.
c) Display the API response calculated field on the next page.

 

My main challenge is how to display the API response on the second page of the AMP mailer after the customer submits the form. Could anyone guide me on implementing this functionality in AMP?

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 Vishwadeep1

Hey @vishwadeep1  Could you please share sample data that you want in email. I will try to test it out.


Hi @_manoj_kumar_ Thank you for the help but I figured out the issue. I was using response.write() to output the response , but it wasn't working. So, I tried using only write() to send the response, and now, after the AMP form submission, I'm able to output the responses on the next page.

 

1 reply

Manoj_Kumar
Community Advisor
Community Advisor
June 27, 2024

Hello @vishwadeep1 

 

Look at this example where data is refresh from a server call

 

Advanced server requests

Manoj  | https://themartech.pro
Level 2
June 28, 2024

Hi @_manoj_kumar_ ,

 

I'm using JSSP to consume form data and will make an external API call to retrieve the Calculated Amount and Total Amount as responses. However, the main challenge I'm encountering is how to pass these variables back as responses to AMP to display after the initial form submission.

 

Regards,

Vishwadeep

Manoj_Kumar
Community Advisor
Community Advisor
June 30, 2024

Hey @vishwadeep1  Could you please share sample data that you want in email. I will try to test it out.

Manoj  | https://themartech.pro