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 ); }