• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Genesis Theme Framework a2z

Genesis Theme Framework a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / genesis_update_email() – Sends out update notification email.

You appear to be a bot. Output may be restricted

Description

Sends out update notification email.

Does several checks before finally sending out a notification email to the specified email address, alerting it to a Genesis update available for that install.

Usage

$void = genesis_update_email();

Parameters

Returns

void Return early if email should not be sent.

Source

File name: genesis/lib/functions/upgrade.php
Lines:

1 to 39 of 39
function genesis_update_email() {

  // Pull email options from DB.
  $email_on = genesis_get_option( 'update_email' );
  $email    = genesis_get_option( 'update_email_address' );

  // If we're not supposed to send an email, or email is blank / invalid, stop.
  if ( ! $email_on || ! is_email( $email ) ) {
    return;
  }

  // Check for updates.
  $update_check = genesis_update_check();

  // If no new version is available, stop.
  if ( ! $update_check ) {
    return;
  }

  // If we've already sent an email for this version, stop.
  if ( get_option( 'genesis-update-email' ) === $update_check['new_version'] ) {
    return;
  }

  // Let's send an email.
  /* translators: 1: Genesis version, 2: URL for current website. */
  $subject = sprintf( __( 'Genesis %1$s is available for %2$s', 'genesis' ), esc_html( $update_check['new_version'] ), home_url() );

  /* translators: %s: Genesis version. */
  $message  = sprintf( __( 'Genesis %s is now available. We have provided 1-click updates for this theme, so please log into your dashboard and update at your earliest convenience.', 'genesis' ), esc_html( $update_check['new_version'] ) );
  $message .= "\n\n" . wp_login_url();

  // Update the option so we don't send emails on every pageload.
  update_option( 'genesis-update-email', $update_check['new_version'], true );

  // Send that puppy!
  wp_mail( sanitize_email( $email ), $subject, $message );

}
 

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: genesis_update_email
Plugin ref: Genesis Framework
Version: 3.3.3
Sourcefile: lib/functions/upgrade.php
File ref: lib/functions/upgrade.php
Deprecated?: No
API Letters: E,G,U

Footer

Genesis a2z
Genesis Theme Framework a2z
WordPress Dynamic API Reference
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  genesis.wp-a2z.org
© Copyright Genesis a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites