I started working on making the redirection work better, but could use some feedback on ideal use cases for redirection off-site.
In the dev branch, I've added an option to redirect to the referrer, which will override webform's redirection settings on a remote submission. This is boring and lackluster - it means a remote post will be taken back to the submission form, and leaves informing the user about what's happening to the remote site.
I think there is probably a good use case for referring back on site, but don't know what the best way is. It would be great to send the user back to the referring site with a message that says "Thank you for submitting form X on site Y," but it leaves too much to be configured on the client side.
If multiple sites are posting to the same form, this gets even trickier.
The best scenario I can think of off-hand is to keep the user on the Drupal, webform site and add a drupal_set_message after submission that includes a link back to the referring domain.
There doesn't seem to be a really ideal way to handle this without some amount of coordination between the posting and submission receiving sites. One of the goals of this project is to allow remote submission of forms on sites that do not run drupal.
Comments
Comment #1
molenick commentedI think for now, the simplest option for completeness is to have a drupal_set_message() that allows the user to return back to the referrer. Not sure if it should redirect to the exact page or to the root page of a site.
In the future, redirect information could be embedded as a field in the remote form itself. The module could check the value against $_SERVER['HTTP_REFERER'] and if they match, allow the redirection to happen. This would require some extra work in creating the embed code, as it would either need to be modified directly by an embedding user, or they'd need to fill out a form for their site that would generate the custom embed code.
This is just an option, not sure if it fits my vision of what should be. Don't want to over-engineer. :)