PluginProbe
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress / trunk
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress vtrunk
4.12.0 4.10.0 4.9.0 4.8.1 trunk 1.0 1.1 1.12.1 1.2.3 1.2.4 1.2.5 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.4.0 1.4.1 1.4.2 All 171 releases
custom-facebook-feed / inc / Email_Notification.php
Email_Notification.php
63 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace CustomFacebookFeed;
4
5 use CustomFacebookFeed\CFF_Education;
6
7 if (!defined('ABSPATH')) {
8 exit; // Exit if accessed directly
9 }
10
11 /**
12 * Class Email_Notification
13 */
14 class Email_Notification
15 {
16 /**
17 * Sends a notification email to the admin(s) of the site.
18 *
19 * @param string $title
20 * @param string $bold
21 * @param string $details
22 *
23 * @return bool
24 */
25 public static function send($title, $bold, $details)
26 {
27 $options = get_option('cff_style_settings');
28
29 $to_string = !empty($options['email_notification_addresses']) ? str_replace(' ', '', $options['email_notification_addresses']) : get_option('admin_email', '');
30
31 $all_emails = explode(',', $to_string);
32 $valid_emails = [];
33
34 foreach ($all_emails as $email) {
35 if (is_email($email)) {
36 $valid_emails[] = $email;
37 }
38 }
39
40 if (empty($valid_emails)) {
41 return false;
42 }
43
44 $headers = array('Content-Type: text/html; charset=utf-8');
45
46 $header_image = CFF_PLUGIN_URL . 'img/balloon-120.png';
47
48 $footer_link = admin_url('admin.php?page=sbi-settings&view=advanced&flag=emails');
49
50 $message_content = '<h6 style="padding:0;word-wrap:normal;font-family:\'Helvetica Neue\',Helvetica,Arial,sans-serif;font-weight:bold;line-height:130%;font-size: 16px;color:#444444;text-align:inherit;margin:0 0 20px 0;Margin:0 0 20px 0;">' . $bold . '</h6>' . $details;
51
52 $educator = new CFF_Education();
53 $dyk_message = $educator->dyk_display();
54
55 ob_start();
56 include_once CFF_PLUGIN_DIR . '/email.php';
57 $email_body = ob_get_contents();
58 ob_get_clean();
59
60 return wp_mail($valid_emails, $title, $email_body, $headers);
61 }
62 }
63