Webform Submission tokens to confirmation page & Webform stuck on "Draft" and Status on "Initialize"

Created on 15 April 2022, over 2 years ago
Updated 17 August 2024, 4 months ago

Problem/Motivation

Being able to display custom confirmation messages utilizing webform submission tokens after payment.

Simple use case:
Thanks for your order, [webform_submission:values:first_name] [webform_submission:values:last_name]!

More complex use case:
I have a form for camp registration, requires insurance information, etc. After the form is submitted and payment is processed offsite and redirects back to confirmation page.. I would like to build a form query which prepopulates previous filled information through submission tokens.

Thanks for registering camp, [webform_submission:values:first_name] [webform_submission:values:last_name]!

<p><a href="https://website/form/camp-registration?parent_name[first]=[webform_submission:values:parent_name:first]&parent_name[last]=[webform_submission:values:parent_name:last]&parent_email=[webform_submission:values:parent_email]&insurance_yn=[webform_submission:values:insurance_yn]&insurance_groupnumber=[webform_submission:values:insurance_group_number]&insurance_policynumber=[webform_submission:values:insurance_policy]&doctor_name=[webform_submission:values:doctor_name]">+ Register a sibling</a></p>

I think the issue right now is the form is submitted as draft before payment is made. After payment is successful the webform is not submitted.

Proposed resolution

I have tried a few different ways to achieve this, even looked into rules but cannot find a solution. I have googled and searched, but was of no help.

I propose the following possibilities.

1. Set default confirmation redirect back to the webform
--- after payment is successful, redirect back to webform and submit the form, and let webform handle the confirmation message.
2. Add ability to set custom confirmation message in the handler itself to be displayed after redirecting to checkout/order_id/complete.
3. Ability to set custom redirect page and also custom message.
4. Ability to use webform submission tokens in the confirmation checkout flow in commerce settings.

If there is another solution readily available please let me know.

πŸ’¬ Support request
Status

Fixed

Version

3.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States Tankeroo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΏπŸ‡¦South Africa vlooi vlerke

    I have the same issue

    When I set email handler to send when draft I get an email but the status is set to "initialize"
    After completing the order and payment is made no webform submissions is send to user to confirm payment, only commers order email is sent.

    How do you set webform product to send email to customer after successful payment?

    Thanks

  • πŸ‡ΊπŸ‡ΈUnited States Tankeroo

    I'm still having this issue. Upon successful payment, commerce and orders are all in order but the submission form is stayed in "Draft" and Status is "Initialize"

    Still have not been able to solve this. Do we have to do it with "Rules" ? Please advise the best route to go anyone who has solved this. Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States Tankeroo

    Updated title to better describe issue.

  • πŸ‡ΊπŸ‡ΈUnited States Tankeroo

    @Vlooi Vlerke
    I went on some digging and found a "Closed" issue ticket which I followed back then. I read it again and it provided a solution. I just did a test and it is fixed now.

    https://www.drupal.org/project/webform_product/issues/3164159 β†’

    Follow this youtube video: https://www.youtube.com/watch?v=zf1ZGKZVGQQ

    You need to go to: Commerce > Configuration > Orders > Order Type
    On the order type you are using on the webform, add a field type "Link" and the machine name must be "field_link_order_origin"

    This fixed the issue for me and my forms are now "Complete" and removed from "Draft"

    I hope this helps!

    As for the form staying in Draft and Initialize, this is considered FIXED.

    However, I'm still not able to set custom complete messages after order. I've updated the confirmation message on the checkout flow but I'm still getting the default:

    Your order number is 24.
    You can view your order on your account page when logged in.

    Any help here?

  • πŸ‡ΏπŸ‡¦South Africa vlooi vlerke

    @Tankeroo

    Thanks, got it working.

    My /admin/commerce/config/checkout-flows default message is using custom text.

    I have set my text editor to use Full HTML and then cleared the cache after saving the new conformation message.

    Hope that helps

  • Status changed to Fixed 5 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024