PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 2.12.8
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v2.12.8
2.12.8 2.12.7 2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 All 98 releases
← All changes | inc/form-submit.php +14 -0 2.12.7 → 2.12.8 View file →
@@ -809,12 +809,26 @@
809 809 if ( $provider->is_active() && '' !== $entry_language ) {
810 810 $provider->switch_language( $entry_language );
811 811 }
812 812
813 + // Entries::add() has stored the logs collected so far. Start the instance
814 + // empty so the update below writes only what send_email() records --
815 + // Entries::update() merges with the stored logs, so anything left here
816 + // would be written twice.
817 + $entries_db_instance = Entries::get_instance();
818 + $entries_db_instance->reset_logs();
819 +
813 820 // Send email after entry creation so {entry_id} is available when smart tags are processed.
814 821 $send_email = $this->send_email( $id, $submission_data, $form_data );
815 822 if ( $send_email ) {
816 823 $emails = $send_email['emails'];
824 + }
825 +
826 + // send_email() logs to the in-memory instance; the entry already exists,
827 + // so the log only reaches it through an update.
828 + $notification_logs = $entries_db_instance->get_logs();
829 + if ( ! empty( $notification_logs ) ) {
830 + Entries::update( Helper::get_integer_value( $entry_id ), [ 'logs' => $notification_logs ] );
817 831 }
818 832
819 833 $confirmation_message = Generate_Form_Markup::get_confirmation_markup( $form_data, $submission_data );
820 834 $redirect_url = Generate_Form_Markup::get_redirect_url( $form_data, $submission_data );