class-model.php
126 lines
| 1 | <?php |
| 2 | /** |
| 3 | * The Emails model for Recipient activation. |
| 4 | * |
| 5 | * @link https://wordpress.org/plugins/broken-link-checker/ |
| 6 | * @since 2.0.0 |
| 7 | * |
| 8 | * @author WPMUDEV (https://wpmudev.com) |
| 9 | * @package WPMUDEV_BLC\App\Emails\Recipient_Activation; |
| 10 | * |
| 11 | * @copyright (c) 2022, Incsub (http://incsub.com) |
| 12 | */ |
| 13 | |
| 14 | namespace WPMUDEV_BLC\App\Emails\Recipient_Activation; |
| 15 | |
| 16 | // Abort if called directly. |
| 17 | defined( 'WPINC' ) || die; |
| 18 | |
| 19 | use WPMUDEV_BLC\Core\Utils\Utilities; |
| 20 | |
| 21 | /** |
| 22 | * Class Settings |
| 23 | * |
| 24 | * @package WPMUDEV_BLC\App\Emails\Recipient_Activation |
| 25 | */ |
| 26 | class Model { |
| 27 | /** |
| 28 | * Returns the header logo of the email. |
| 29 | * |
| 30 | * @return string |
| 31 | */ |
| 32 | public static function header_logo() { |
| 33 | return apply_filters( |
| 34 | 'wpmudev_blc_scan_report_email_header_logo', |
| 35 | esc_url( WPMUDEV_BLC_ASSETS_URL . 'images/blc-logo-white-28x28.png' ) |
| 36 | ); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Returns the BLC Title to be used in the email header. |
| 41 | * |
| 42 | * @return string |
| 43 | */ |
| 44 | public static function header_title() { |
| 45 | return apply_filters( |
| 46 | 'wpmudev_blc_scan_report_email_header_title', |
| 47 | __( 'Broken Link Notification', 'brocken-link-checker' ) |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Returns home url. |
| 53 | * |
| 54 | * @retun string |
| 55 | */ |
| 56 | public static function get_hub_home_url() { |
| 57 | return Utilities::hub_home_url(); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Returns the header logo of the email. |
| 62 | * |
| 63 | * @return string |
| 64 | */ |
| 65 | public static function footer_logo() { |
| 66 | return apply_filters( |
| 67 | 'wpmudev_blc_scan_report_email_header_logo', |
| 68 | esc_url( WPMUDEV_BLC_ASSETS_URL . 'images/footer-slogan.png' ) |
| 69 | ); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Returns social links info. |
| 74 | * |
| 75 | * @return array |
| 76 | */ |
| 77 | public static function social_links() { |
| 78 | return apply_filters( |
| 79 | 'wpmudev_blc_scan_report_email_social_data', |
| 80 | array( |
| 81 | 'facebook' => array( |
| 82 | 'icon' => WPMUDEV_BLC_ASSETS_URL . 'images/social/facebook-dark-7x14.png', |
| 83 | 'url' => 'https://www.facebook.com/wpmudev', |
| 84 | ), |
| 85 | 'instagram' => array( |
| 86 | 'icon' => WPMUDEV_BLC_ASSETS_URL . 'images/social/instagram-dark-14x14.png', |
| 87 | 'url' => 'https://www.instagram.com/wpmu_dev/', |
| 88 | ), |
| 89 | 'twitter' => array( |
| 90 | 'icon' => WPMUDEV_BLC_ASSETS_URL . 'images/social/twitter-dark-13x11.png', |
| 91 | 'url' => 'https://twitter.com/wpmudev/', |
| 92 | ), |
| 93 | ) |
| 94 | ); |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Returns the social links for the email footer. |
| 99 | */ |
| 100 | public static function get_social_links() { |
| 101 | $social_data = self::social_links(); |
| 102 | $output = ''; |
| 103 | |
| 104 | if ( ! empty( $social_data ) ) { |
| 105 | $output .= '<tr>'; |
| 106 | $output .= '<td><span style="font-weight: 700;font-size: 13px;">' . esc_html__( 'Follow us', 'broken-link-checker' ) . '</span></td>'; |
| 107 | |
| 108 | foreach ( $social_data as $key => $data ) { |
| 109 | $url = $data['url']; |
| 110 | $icon = $data['icon']; |
| 111 | $output .= "<td> |
| 112 | <a href=\"{$url}\" target=\"_blank\"> |
| 113 | <img height=\"13\" src=\"{$icon}\" style=\"border-radius:3px;display:block;max-height:13px;margin-left: 10px;\" /> |
| 114 | </a> |
| 115 | </td> |
| 116 | "; |
| 117 | } |
| 118 | |
| 119 | $output .= '<tr>'; |
| 120 | } |
| 121 | |
| 122 | return "<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"float:none;display:inline-table;\">{$output}</table>"; |
| 123 | } |
| 124 | |
| 125 | } |
| 126 |