libreform / wp-libre-form

Easy native HTML5 forms for WordPress. Version 1.5 is unmaintained, but works without issue. 2.0 has been rewritten from the ground, and can be found at https://github.com/libreform/libreform
https://wordpress.org/plugins/wp-libre-form
GNU General Public License v3.0
67 stars 27 forks source link

Better emails #74

Closed timiwahalahti closed 7 years ago

timiwahalahti commented 7 years ago

This PR adds metabox where user can change form header, subject and content of email. All form fields can be used everywhere and there's also few global details which can be used; submission-id, referrer, form-title, form-id, user-id, timestamp, datetime, language, all-form-data.

Test, translate and update documentation before merge.

In a way, relates to #37.

timiwahalahti commented 7 years ago

Fixed build errors and handling of values which are arrays.

Previously fields with array values got saved wrongly because those were put throught esc_html and wp_json_encode. Removed these because add_post_meta does serialization and added maybe_unserialize with implode.

Also introduced three new filters to change glue for implode: wplf_email_array_field_implode_glue wplf_{$form->post_name}_email_array_field_implode_glue wplf_{$form->ID}_email_array_field_implode_glue

anttiviljami commented 7 years ago

This is probably not intended behaviour

screen shot 2017-10-25 at 12 22 42
anttiviljami commented 7 years ago

Brilliant stuff! Maybe we should pre-populate the email content with some sensible template containing %all-form-fields% ? Right now it's a bit too easy to accidentally save an empty content for the email

anttiviljami commented 7 years ago

No wait. :) That's exactly what it already does. Nevermind.

I'm just gonna go ahead and merge.

Thank you so much!

sparkalow commented 6 years ago

Is this feature released?

k1sul1 commented 6 years ago

Nope, the last release was released on Oct 24 and this was merged on Oct 26.

But we try to not break the master branch, so you can use that.

@anttiviljami @timiwahalahti should we do a release in the near future? There's bugfixes, new features and improvements. I think. GitHub kinda makes it hard to check that what does master contain that isn't in a release.