PluginProbe ʕ •ᴥ•ʔ
Reviews Feed – Add Testimonials and Customer Reviews From Google Reviews, Yelp, TripAdvisor, and More / 2.11.0
Reviews Feed – Add Testimonials and Customer Reviews From Google Reviews, Yelp, TripAdvisor, and More v2.11.0
2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.7 2.6.8 2.6.5 2.6.4 2.6.3 2.6.2 2.6.0 2.5.5 2.5.4 2.5.3 2.5.2 trunk 1.0 1.0.1 1.0.2 1.0.3 1.1 1.1.1 1.1.2 1.2.0 2.0 2.1.0 2.1.1 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.5.0 2.5.1
reviews-feed / class / Common / Email_Notification.php
reviews-feed / class / Common Last commit date
Admin 1 week ago Builder 1 week ago Customizer 1 week ago Exceptions 1 week ago Helpers 1 week ago Integrations 1 week ago Migrations 1 week ago ReviewAlerts 1 week ago Services 1 week ago Settings 1 week ago Support 1 week ago Traits 1 week ago UsageTracking 1 week ago Utils 1 week ago AuthorizationStatusCheck.php 1 week ago BusinessDataCache.php 1 week ago Clear_Cache.php 1 week ago Container.php 1 week ago DisplayElements.php 1 week ago Email_Notification.php 1 week ago Error_Reporter.php 1 week ago Feed.php 1 week ago FeedCache.php 1 week ago FeedCacheUpdater.php 1 week ago FeedDisplay.php 1 week ago Feed_Locator.php 1 week ago Parser.php 1 week ago PostAggregator.php 1 week ago RemoteRequest.php 1 week ago SBR_Education.php 1 week ago SBR_Schema_Service.php 1 week ago SBR_Settings.php 1 week ago ServiceContainer.php 1 week ago SinglePostCache.php 1 week ago TemplateRenderer.php 1 week ago Tooltip_Wizard.php 1 week ago Util.php 1 week ago
Email_Notification.php
57 lines
1 <?php
2
3 namespace SmashBalloon\Reviews\Common;
4
5 /**
6 * Class Email_Notification
7 */
8 class Email_Notification
9 {
10 /**
11 * Sends a notification email to the admin(s) of the site.
12 *
13 * @param string $title
14 * @param string $bold
15 * @param string $details
16 *
17 * @return bool
18 */
19 public static function send($title, $bold, $details)
20 {
21 $options = get_option('cff_style_settings');
22
23 $to_string = !empty($options['email_notification_addresses']) ? str_replace(' ', '', $options['email_notification_addresses']) : get_option('admin_email', '');
24
25 $all_emails = explode(',', $to_string);
26 $valid_emails = [];
27
28 foreach ($all_emails as $email) {
29 if (is_email($email)) {
30 $valid_emails[] = $email;
31 }
32 }
33
34 if (empty($valid_emails)) {
35 return false;
36 }
37
38 $headers = array('Content-Type: text/html; charset=utf-8');
39
40 $header_image = SBR_PLUGIN_URL . '/assets/images/balloon-120.png';
41
42 $footer_link = admin_url('admin.php?page=sbr-settings&view=advanced&flag=emails');
43
44 $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;
45
46 $educator = new SBR_Education();
47 $dyk_message = $educator->dyk_display();
48
49 ob_start();
50 include_once SBR_PLUGIN_URL . '/templates/email.php';
51 $email_body = ob_get_contents();
52 ob_get_clean();
53
54 return wp_mail($valid_emails, $title, $email_body, $headers);
55 }
56 }
57