Admin
2 weeks ago
Builder
2 weeks ago
Helpers
2 weeks ago
Integrations
2 weeks ago
CFF_Autolink.php
2 weeks ago
CFF_Blocks.php
2 weeks ago
CFF_Cache.php
2 weeks ago
CFF_Education.php
2 weeks ago
CFF_Elementor_Base.php
2 weeks ago
CFF_Elementor_Widget.php
2 weeks ago
CFF_Error_Reporter.php
2 weeks ago
CFF_FB_Settings.php
2 weeks ago
CFF_Feed_Elementor_Control.php
2 weeks ago
CFF_Feed_Locator.php
2 weeks ago
CFF_Feed_Pro.php
2 weeks ago
CFF_GDPR_Integrations.php
2 weeks ago
CFF_Group_Posts.php
2 weeks ago
CFF_HTTP_Request.php
2 weeks ago
CFF_Oembed.php
2 weeks ago
CFF_Parse.php
2 weeks ago
CFF_Resizer.php
2 weeks ago
CFF_Response.php
2 weeks ago
CFF_Shortcode.php
2 weeks ago
CFF_Shortcode_Display.php
2 weeks ago
CFF_SiteHealth.php
2 weeks ago
CFF_Utils.php
2 weeks ago
CFF_View.php
2 weeks ago
Custom_Facebook_Feed.php
2 weeks ago
Email_Notification.php
2 weeks ago
Platform_Data.php
2 weeks ago
SB_Facebook_Data_Encryption.php
2 weeks ago
SB_Facebook_Data_Manager.php
2 weeks ago
index.php
2 weeks ago
Email_Notification.php
63 lines
| 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 |