PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.1
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.1
6.2.3 6.2.2 6.2.1 6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 All 156 releases
← All changes | class/class-mainwp-notification.php +33 -0 6.1.6 → 6.2.1 View file →
@@ -325,8 +325,41 @@
325 325 }
326 326
327 327
328 328 /**
329 + * Start notification for auto update info.
330 + *
331 + * @param array $admin_email_settings Admin email settings.
332 + * @param array $params Parameters for the notification.
333 + *
334 + * @return void
335 + */
336 + public static function start_notification_auto_updates_info( $admin_email_settings, $params = array() ) {
337 +
338 + $email = isset( $admin_email_settings['recipients'] ) ? $admin_email_settings['recipients'] : '';
339 + $subject = isset( $admin_email_settings['subject'] ) ? $admin_email_settings['subject'] : '';
340 + $plain_text = isset( $params['plain_text'] ) ? $params['plain_text'] : false;
341 + $mail_content = isset( $params['mail_content'] ) ? $params['mail_content'] : '';
342 +
343 + if ( $plain_text ) {
344 + $content_type = "Content-Type: text/plain; charset=\"utf-8\"\r\n";
345 + } else {
346 + $content_type = "Content-Type: text/html; charset=\"utf-8\"\r\n";
347 + }
348 +
349 + if ( ! empty( $email ) && ! empty( $mail_content ) ) {
350 + MainWP_Logger::instance()->log_events( 'auto-updates', 'Auto updates notification :: send mail' );
351 + static::send_wp_mail(
352 + $email,
353 + $subject,
354 + $mail_content,
355 + $content_type
356 + );
357 + }
358 + }
359 +
360 +
361 + /**
329 362 * Method send_wp_mail().
330 363 *
331 364 * Send email via wp_mail().
332 365 *