fixed error in loop option email with _name
This commit is contained in:
@@ -171,7 +171,13 @@ function update_emails_settings_option_CIPF($request, $option_name, $option_data
|
||||
//error_log("option_data bedore: " . json_encode($option_data));
|
||||
foreach ($option_data as $email_type => $email_options) {
|
||||
//error_log("email_type: " . $email_type);
|
||||
$option_data[$email_type] = update_email_by_type_CIPF($email_type, $email_options, $request);
|
||||
if ($email_type === '_name') {
|
||||
continue;
|
||||
}
|
||||
$ret_email = update_email_by_type_CIPF($email_type, $email_options, $request);
|
||||
if ($ret_email !== false) {
|
||||
$option_data[$email_type] = $ret_email;
|
||||
}
|
||||
}
|
||||
//error_log("option_data after : " . json_encode($option_data));
|
||||
|
||||
@@ -187,6 +193,10 @@ function update_emails_settings_option_CIPF($request, $option_name, $option_data
|
||||
function update_email_by_type_CIPF($email_type, $email_options, $request) {
|
||||
Plgntls::debug_infos();
|
||||
//error_log("email type: " . $email_type);
|
||||
if ($email_type === '_name') {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* set notification/confirmation_send to false by default,
|
||||
* because the request only contains the value 'on' if checked, nothing for false
|
||||
|
||||
@@ -39,6 +39,7 @@ function prepare_emails_CIPF($email_name, $user_id) {
|
||||
}
|
||||
$user = get_user_by('id', $user_id);
|
||||
$user_email = $user->user_email;
|
||||
$headers = array('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
|
||||
$emails_option = Plgntls::get_option_safe($emails_option_object);
|
||||
@@ -57,7 +58,7 @@ function prepare_emails_CIPF($email_name, $user_id) {
|
||||
$tmp_email['to'] = $email['notification_to'];
|
||||
$tmp_email['subject'] = $email['notification_subject'];
|
||||
$tmp_email['message'] = $email['notification_message'];
|
||||
$tmp_email['headers'] = array('Content-Type: text/html; charset=UTF-8');
|
||||
$tmp_email['headers'] = $headers;
|
||||
$emails[] = $tmp_email;
|
||||
}
|
||||
if ($email['confirmation_send']) {
|
||||
@@ -65,7 +66,7 @@ function prepare_emails_CIPF($email_name, $user_id) {
|
||||
$tmp_email['to'] = $user_email;
|
||||
$tmp_email['subject'] = $email['confirmation_subject'];
|
||||
$tmp_email['message'] = $email['confirmation_message'];
|
||||
$tmp_email['headers'] = array('Content-Type: text/html; charset=UTF-8');
|
||||
$tmp_email['headers'] = $headers;
|
||||
$emails[] = $tmp_email;
|
||||
}
|
||||
return $emails;
|
||||
|
||||
Reference in New Issue
Block a user