function wpsight_mail_options($options) { $opts = array(); $sender = wpsight_mail_get_default_sender(); $opts['heading_mail'] = array('name' => __('Mailing', 'wpsight'), 'id' => 'heading_mail', 'type' => 'heading'); $opts['mail_sender_email'] = array('name' => __('Sender Email', 'wpsight'), 'desc' => sprintf(__('Carefully choose the desired sender email address. Ideally choose one that\'s hosted at your web host as well. Misconfiguration may lead to false-positive spam detection. Leave empty to use default: <code>%s</code>', 'wpsight'), $sender['email']), 'id' => 'mail_sender_email', 'std' => '', 'type' => 'text'); $opts['mail_sender_name'] = array('name' => __('Sender Name', 'wpsight'), 'desc' => sprintf(__('Relates to the email address specified above. Leave empty to use default: <code>%s</code>', 'wpsight'), $sender['name']), 'id' => 'mail_sender_name', 'std' => '', 'type' => 'text'); $opts['mail_transport'] = array('name' => __('Mail Transport', 'wpsight'), 'desc' => __('SMTP or native', 'wpsight'), 'id' => 'mail_transport', 'std' => 'native', 'type' => 'select', 'options' => array('native' => __('Native', 'wpsight'), 'smtp' => __('SMTP', 'wpsight'))); $opts['mail_smtp_host'] = array('name' => __('SMTP Host', 'wpsight'), 'desc' => __('The server to use, e.g. smtp.provider.com', 'wpsight'), 'id' => 'mail_smtp_host', 'std' => '', 'type' => 'text', 'class' => 'hidden'); $opts['mail_smtp_port'] = array('name' => __('SMTP Port', 'wpsight'), 'desc' => __('The SMTP port to use, usually 25', 'wpsight'), 'id' => 'mail_smtp_port', 'std' => 25, 'type' => 'text', 'class' => 'hidden'); $opts['mail_smtp_sec'] = array('name' => __('SMTP Encryption', 'wpsight'), 'desc' => __('Whether to use SMTP encryption', 'wpsight'), 'id' => 'mail_smtp_sec', 'std' => '', 'type' => 'select', 'options' => array('' => __('None', 'wpsight'), 'tls' => __('TLS', 'wpsight'), 'ssl' => __('SSL', 'wpsight')), 'class' => 'hidden'); $opts['mail_smtp_user'] = array('name' => __('SMTP User', 'wpsight'), 'desc' => __('SMTP User. Leave empty if your SMTP server doesn\'t require authentication', 'wpsight'), 'id' => 'mail_smtp_user', 'std' => '', 'type' => 'text', 'class' => 'hidden'); $opts['mail_smtp_pass'] = array('name' => __('SMTP Password', 'wpsight'), 'desc' => __('SMTP Password. Might be empty.', 'wpsight'), 'id' => 'mail_smtp_pass', 'std' => '', 'type' => 'text', 'class' => 'hidden'); return array_merge($options, apply_filters('wpsight_mail_options', $opts)); }
protected function _get_sender() { $name = wpsight_get_option('mail_sender_name'); $email = wpsight_get_option('mail_sender_email'); $defaults = wpsight_mail_get_default_sender(); if (empty($name)) { $name = $defaults['name']; } if (empty($email)) { $email = $defaults['email']; } return apply_filters('wpsight_contact_sender', array('email' => $email, 'name' => $name)); }