/** * Migrate post and email notification settings into actions */ private function migrate_to_16() { global $wpdb; $forms = FrmDb::get_results($this->forms, array(), 'id, options, is_template, default_template'); /** * Old email settings format: * email_to: Email or field id * also_email_to: array of fields ids * reply_to: Email, field id, 'custom' * cust_reply_to: string * reply_to_name: field id, 'custom' * cust_reply_to_name: string * plain_text: 0|1 * email_message: string or '' * email_subject: string or '' * inc_user_info: 0|1 * update_email: 0, 1, 2 * * Old autoresponder settings format: * auto_responder: 0|1 * ar_email_message: string or '' * ar_email_to: field id * ar_plain_text: 0|1 * ar_reply_to_name: string * ar_reply_to: string * ar_email_subject: string * ar_update_email: 0, 1, 2 * * New email settings: * post_content: json settings * post_title: form id * post_excerpt: message * */ foreach ($forms as $form) { if ($form->is_template && $form->default_template) { // don't migrate the default templates since the email will be added anyway continue; } // Format form options $form_options = maybe_unserialize($form->options); // Migrate settings to actions FrmXMLHelper::migrate_form_settings_to_actions($form_options, $form->id); } }