foreach ($flatpickr_languages as $flatpickr_language) {
wp_register_script("flatpickr-locale-{$flatpickr_language}",
- asset("scripts/flatpickr/locale/{$flatpickr_language}.js"),
- ['flatpickr'], // Dependencies
- null, // Version
- true // In footer?
+ asset("scripts/flatpickr/locale/{$flatpickr_language}.js"),
+ ['flatpickr'], // Dependencies
+ null, // Version
+ true // In footer?
);
}
//$this->pre_process();
$headers = [];
- $data = [];
+ //$data = [];
$to = $this->destination;
- $from = 'Spine pro <no-reply@spinepro.fr>';
+ $from = '';
$subject = $this->form_title;
- $content_type = 'text/html';
+ $content_type = 'text/plain';
$charset = get_bloginfo('charset');
- $headers[] = sprintf('Return-Path: %s', $return_path);
$headers[] = sprintf('Content-Type: %s; charset=%s', $content_type, $charset);
- $headers[] = sprintf('From: %s', $from);
- // Gather filled fields into label/value pairs
+ $message = '';
foreach ($this->fields as $field_name => $field) {
if(!in_array($field_name,['years','months'])) {
if ($value = $this->get_data($field_name)) {
- $data[$field->get_title()] = $value;
+ $label = str_replace(':','',$field->get_title());
+ $message .= $label.': '. $value;
+ $message .= "\r\n";
}
}
}
- $data['How long have you been suffering ?'] = 'Years: '.$this->get_data('years').' - Months: '.$this->get_data('months');
-
- $message = view('forms.common.email', compact('data', 'subject'));
+ $message .= 'How long have you been suffering ?: '.'Years: '.$this->get_data('years').' - Months: '.$this->get_data('months');
// Hook directly into WPMailer temporarily so we can add attachments and set their proper filenames
add_action('phpmailer_init', [$this, 'attach_files']);
return $value;
}
-}
+}
\ No newline at end of file
}
}, ['helpers', 'setup', 'filters', 'admin']);
-function force_host( $phpmailer ) {
+/*function force_host( $phpmailer ) {
$host = parse_url( get_site_url(), PHP_URL_HOST );
$phpmailer->Sender = 'spinepro@'.$host;
}
-add_action( 'phpmailer_init', 'force_host' );
-
+add_action( 'phpmailer_init', 'force_host' );*/
function delete_post_type(){
unregister_post_type( 'scientific_news' );