| @@ -50,8 +50,13 @@ | ||
| 50 | 50 | */ |
| 51 | 51 | public function get_headers() { |
| 52 | 52 | $headers = 'MIME-Version: 1.0' . "\r\n"; |
| 53 | 53 | $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; |
| 54 | + $from = get_bloginfo( 'name' ); | |
| 55 | + $from_email = timetics_get_option('booking_created_customer_email_from'); | |
| 56 | + | |
| 57 | + // Append the "From" header | |
| 58 | + $headers .= 'From: ' .$from. ' <' . $from_email . '> ' . "\r\n"; | |
| 54 | 59 | |
| 55 | 60 | return $headers; |
| 56 | 61 | } |
| 57 | 62 | |
| @@ -78,9 +83,8 @@ | ||
| 78 | 83 | $body = ob_get_clean(); // Retrieve and clean output buffer |
| 79 | 84 | echo wp_kses_post( $body ); // Output the email body |
| 80 | 85 | } |
| 81 | 86 | } |
| 82 | - | |
| 83 | 87 | /** |
| 84 | 88 | * Add email footer |
| 85 | 89 | * |
| 86 | 90 | * @return void |
| @@ -120,5 +124,46 @@ | ||
| 120 | 124 | $data = apply_filters( 'timetics/admin/email/send', [$to, $subject, $message, $headers] ); |
| 121 | 125 | |
| 122 | 126 | return wp_mail( ...$data ); |
| 123 | 127 | } |
| 128 | + | |
| 129 | + public function sanitize_content( $content ) { | |
| 130 | + // Define the allowed HTML tags and attributes | |
| 131 | + $allowed_tags = array( | |
| 132 | + 'a' => array( | |
| 133 | + 'href' => true, | |
| 134 | + 'title' => true, | |
| 135 | + ), | |
| 136 | + 'abbr' => array( | |
| 137 | + 'title' => true, | |
| 138 | + ), | |
| 139 | + 'acronym' => array( | |
| 140 | + 'title' => true, | |
| 141 | + ), | |
| 142 | + 'b' => array(), | |
| 143 | + 'blockquote' => array( | |
| 144 | + 'cite' => true, | |
| 145 | + ), | |
| 146 | + 'cite' => array(), | |
| 147 | + 'code' => array(), | |
| 148 | + 'del' => array( | |
| 149 | + 'datetime' => true, | |
| 150 | + ), | |
| 151 | + 'em' => array(), | |
| 152 | + 'i' => array(), | |
| 153 | + 'q' => array( | |
| 154 | + 'cite' => true, | |
| 155 | + ), | |
| 156 | + 'img' => array ( | |
| 157 | + 'src' => true, | |
| 158 | + 'data-*' => true | |
| 159 | + ), | |
| 160 | + 'strike' => array(), | |
| 161 | + 'strong' => array(), | |
| 162 | + ); | |
| 163 | + | |
| 164 | + $sanitized_content = wp_kses( $content, $allowed_tags ); | |
| 165 | + | |
| 166 | + return $sanitized_content; | |
| 167 | + } | |
| 168 | + | |
| 124 | 169 | } |