class-evf-settings-email.php
3 years ago
class-evf-settings-general.php
5 years ago
class-evf-settings-integrations.php
6 years ago
class-evf-settings-misc.php
2 years ago
class-evf-settings-page.php
7 years ago
class-evf-settings-recaptcha.php
2 years ago
class-evf-settings-validation.php
6 years ago
class-evf-settings-email.php
114 lines
| 1 | <?php |
| 2 | /** |
| 3 | * EverestForms Email Settings |
| 4 | * |
| 5 | * @package EverestForms\Admin |
| 6 | * @version 1.0.0 |
| 7 | */ |
| 8 | |
| 9 | defined( 'ABSPATH' ) || exit; |
| 10 | |
| 11 | if ( class_exists( 'EVF_Settings_Email', false ) ) { |
| 12 | return new EVF_Settings_Email(); |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * EVF_Settings_Email. |
| 17 | */ |
| 18 | class EVF_Settings_Email extends EVF_Settings_Page { |
| 19 | |
| 20 | /** |
| 21 | * Constructor. |
| 22 | */ |
| 23 | public function __construct() { |
| 24 | $this->id = 'email'; |
| 25 | $this->label = esc_html__( 'Email', 'everest-forms' ); |
| 26 | |
| 27 | parent::__construct(); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Get settings array. |
| 32 | * |
| 33 | * @return array |
| 34 | */ |
| 35 | public function get_settings() { |
| 36 | $settings = apply_filters( |
| 37 | 'everest_forms_email_settings', |
| 38 | array( |
| 39 | array( |
| 40 | 'title' => esc_html__( 'Template Settings', 'everest-forms' ), |
| 41 | 'type' => 'title', |
| 42 | 'desc' => '', |
| 43 | 'id' => 'email_template_options', |
| 44 | ), |
| 45 | array( |
| 46 | 'title' => esc_html__( 'Template', 'everest-forms' ), |
| 47 | 'type' => 'radio-image', |
| 48 | 'id' => 'everest_forms_email_template', |
| 49 | 'desc' => esc_html__( 'Determine which format of email to send. HTML Template is default.', 'everest-forms' ), |
| 50 | 'default' => 'default', |
| 51 | 'options' => array( |
| 52 | 'default' => array( |
| 53 | 'name' => esc_html__( 'HTML Template', 'everest-forms' ), |
| 54 | 'image' => plugins_url( 'assets/images/email-template-html.png', EVF_PLUGIN_FILE ), |
| 55 | ), |
| 56 | 'none' => array( |
| 57 | 'name' => esc_html__( 'Plain text', 'everest-forms' ), |
| 58 | 'image' => plugins_url( 'assets/images/email-template-plain.png', EVF_PLUGIN_FILE ), |
| 59 | ), |
| 60 | ), |
| 61 | ), |
| 62 | array( |
| 63 | 'title' => esc_html__( 'Enable copies', 'everest-forms' ), |
| 64 | 'desc' => esc_html__( 'Enable the use of Cc and Bcc email addresses', 'everest-forms' ), |
| 65 | 'desc_tip' => esc_html__( 'Email addresses for Cc and Bcc can be applied from the form notification settings.', 'everest-forms' ), |
| 66 | 'id' => 'everest_forms_enable_email_copies', |
| 67 | 'default' => 'no', |
| 68 | 'type' => 'checkbox', |
| 69 | ), |
| 70 | array( |
| 71 | 'title' => esc_html__( 'Send Test Email To', 'everest-forms' ), |
| 72 | 'desc' => esc_html__( 'Enter email address where test email will be sent.', 'everest-forms' ), |
| 73 | 'id' => 'everest_forms_email_send_to', |
| 74 | 'type' => 'email', |
| 75 | 'placeholder' => 'eg. testemail@gmail.com', |
| 76 | 'value' => get_option( 'everest_forms_email_send_to', '' ) ? esc_attr( get_option( 'everest_forms_email_send_to', '' ) ) : esc_attr( get_bloginfo( 'admin_email' ) ), |
| 77 | 'desc_tip' => true, |
| 78 | ), |
| 79 | array( |
| 80 | 'title' => __( 'Send Test Email', 'everest-forms' ), |
| 81 | 'desc' => __( 'Click to send test email.', 'everest-forms' ), |
| 82 | 'id' => 'everest_forms_email_test', |
| 83 | 'type' => 'link', |
| 84 | 'buttons' => array( |
| 85 | array( |
| 86 | 'title' => __( 'Send Test Email', 'everest-forms' ), |
| 87 | 'href' => 'javascript:;', |
| 88 | 'class' => 'everest_forms_send_email_test', |
| 89 | ), |
| 90 | ), |
| 91 | 'desc_tip' => true, |
| 92 | ), |
| 93 | array( |
| 94 | 'type' => 'sectionend', |
| 95 | 'id' => 'email_template_options', |
| 96 | ), |
| 97 | ) |
| 98 | ); |
| 99 | |
| 100 | return apply_filters( 'everest_forms_get_settings_' . $this->id, $settings ); |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Save settings. |
| 105 | */ |
| 106 | public function save() { |
| 107 | $settings = $this->get_settings(); |
| 108 | |
| 109 | EVF_Admin_Settings::save_fields( $settings ); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | return new EVF_Settings_Email(); |
| 114 |