Skip to content

Commit

Permalink
Merge pull request #136 from SparkPost/template-validation
Browse files Browse the repository at this point in the history
validation error for template & smtp
  • Loading branch information
rajumsys committed Feb 9, 2018
2 parents 7f13ec0 + 2aec219 commit 5857b5c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions admin.widget.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ public function sanitize_basic($input)
break;
}

//validate template with HTTP API only
if($new_input['sending_method'] !== 'api' && !empty($new_input['template'])) {
add_settings_error('template', esc_attr('template'), sprintf("Template is not supported with SMTP methods. So template <i>%s</i> is removed from your settings.", $input['template']), 'error');
$new_input['template'] = '';
}

return $new_input;
}

Expand Down

0 comments on commit 5857b5c

Please sign in to comment.