PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Remove inline styles on confirmation message

  1. Nowton
    Member

    We have an orderform outputting all_fields in the confirmation message. There's a lot of inline styles on the resulting table (cells). How can we remove those?

    Posted 11 years ago on Wednesday September 12, 2012 | Permalink
  2. The all_fields helper uses a table layout with a lot of inline styles, as you have discovered. There is no filter to remove those inline styles. If you'd like complete control over the styling of the confirmation message, you can craft your own HTML and insert the merge tags for each field.

    If you need additional assistance with that, please post a link to your form. Thank you.

    Posted 11 years ago on Friday September 14, 2012 | Permalink
  3. Nowton
    Member

    http://laurent.nl/shop-2/ this is an order form with a lot of products. We'd rather not craft every response field manually as that would mean a lot of empty fields for non-ordered products.

    Posted 11 years ago on Friday September 14, 2012 | Permalink
  4. The {all_fields} helper has hard coded table and inline styles in it. There is no filter to work around that output. If you want more control over the display of the output in your confirmation you will have to use your own HTML and styles. You can use conditional shortcodes to limit the display when their was no data input.

    http://www.gravityhelp.com/documentation/page/Shortcodes#Conditional_Shortcode

    You could also craft your own confirmation message and include logic in it to output only fields which have data in them. You can use the gform_confirmation filter to craft your own confirmation message based on submitted values http://www.gravityhelp.com/documentation/page/Gform_confirmation

    The {all_fields} helper has a specific use and it does not appear that your use is one of them. To have complete control over the look of the confirmation, you will have to create it yourself.

    Posted 11 years ago on Friday September 14, 2012 | Permalink
  5. Nowton
    Member

    In the meantime I have read and tested http://gravitywiz.com/2012/08/04/better-pre-submission-confirmation/ with {product_summary}. Unfortunately that is loaded with inline styles as well. As a sidenote: 'Developers, please refrain from any styling in your plugins'.

    Conditional logic is unfeasible in this case as we would have to create separate conditions for 16 products, with 2 more variants.

    Unfortunately crafting a custom gform confirmation isn't documented anywhere. I should have advised them to use an e-commerce plugin...

    Posted 11 years ago on Wednesday September 26, 2012 | Permalink
  6. The gform_confirmation filter is documented here, with examples of how to change the confirmation:
    http://www.gravityhelp.com/documentation/page/Gform_confirmation (lines 7 and 8 in the second example is where you would place all your conditions.)

    I brought your other suggestions to the attention of the developers. Thank you for your comments.

    Posted 11 years ago on Wednesday September 26, 2012 | Permalink
  7. The inline styles are necessary for the pre-built layout to display properly in a variety of email clients. If all the email clients equally supported remote stylesheets then we would have obviously externalized any presentational elements. That's simply not the case.. inline styles are necessary to support as many different email clients/services as we can. If thats a problem for you, then you should probably jump into the discussions on standardizing HTML email support somewhere.

    Now , you say "Developers, please refrain from any styling in your plugins"..

    Again, as Chris stated, using the default {all_fields} token/layout is completely optional. It is intended as a helper for those who want a nice, simple email layout without having to take the time to code it themselves. You're always welcome to craft your own markup and present the content in the email any way you see fit. The world is your oyster.

    Posted 11 years ago on Wednesday September 26, 2012 | Permalink