public function render_password_field() { $api_key = SparkPost::obfuscate_api_key($this->settings['password']); printf('<input type="text" id="password" name="sp_settings[password]" class="regular-text" value="%s" /><br/> <small><ul><li>For SMTP, set up an API key with the <strong>Send via SMTP</strong> permission</li> <li>For HTTP API, set up an API Key with the <strong>Transmissions: Read/Write</strong> permission</li><a href="https://support.sparkpost.com/customer/portal/articles/1933377-create-api-keys" target="_blank">Need help creating a SparkPost API key?</a></small>', isset($api_key) ? $api_key : ''); }
protected function get_request_headers($hide_api_key = false) { $api_key = apply_filters('wpsp_api_key', $this->settings['password']); if ($hide_api_key) { $api_key = SparkPost::obfuscate_api_key($api_key); } return apply_filters('wpsp_request_headers', array('User-Agent' => 'wordpress-sparkpost', 'Content-Type' => 'application/json', 'Authorization' => $api_key)); }