05-15-2012 12:47 PM
- We have an existing form that is submitted to another 3rd-party service via their API
- We want to add a "Subscribe to newsletter" checkbox. If checked, the email address only will be sent to a Constant Contact List
To do these both with one form, I will need to make an Ajax request to the first service, and in the success handler, fire off the relevant data to the other service.
In the old days-- impossible. Cross-origin policy would block the script from executing. But now that a service can return a response with CORS headers set, it should be not only possible, but easy!
Problem: the other 3rd-party service does NOT currently set the necessary headers.
Question: does Constant Contact's API have a way to close the Ajax loop and trigger the success handler? It doesn't matter at all which order things go in; I'm happy to send to CC first and then the other service on success.
Solved! Go to Solution.
05-15-2012 04:49 PM
We have not implemented the cross-origin resource sharing (CORS), and are not likely to do so in the foreseeable future, so your best option is still to use a server-side solution.
05-17-2012 09:43 AM
Thanks, Mark. Not the answer I hoped for obviously (nor when Salesforce gave it to me!) but an answer nonetheless that lets me move forward with what I need to do.