PluginProbe
Getwid – Gutenberg Blocks / 2.0.8
Getwid – Gutenberg Blocks v2.0.8
3.0.1 3.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.2.0 trunk 1.8.7 1.9.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9
getwid / includes / mailer.php

mailer.php in Getwid – Gutenberg Blocks 2.0.8, at includes/mailer.php

42 lines 971 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Getwid;
4
5 class Mailer {
6
7 public function __construct() {
8 }
9
10 /**
11 * Send an email.
12 * @param string|array $to Array or comma-separated list of email addresses to send message.
13 * @param string $subject
14 * @param string $message
15 * @param array|string $headers Optional. Additional headers.
16 * @param array|string $attachments Optional. Files to attach.
17 * @return bool success
18 */
19 public function send( $to, $subject, $message, $headers = null, $attachments = null ){
20
21 add_filter( 'wp_mail_content_type', array( $this, 'filterContentType' ) );
22
23 $result = wp_mail( $to, $subject, $message, $headers, $attachments );
24
25 remove_filter( 'wp_mail_content_type', array( $this, 'filterContentType' ) );
26
27 return $result;
28 }
29
30 /**
31 * Filter email content type.
32 *
33 * @param string $contentType
34 *
35 * @return string
36 */
37 public function filterContentType( $contentType ){
38 return 'text/html';
39 }
40
41 }
42