Making WordPress.org

Changeset 10122


Ignore:
Timestamp:
08/06/2020 07:56:30 AM (4 years ago)
Author:
dd32
Message:

Plugin Directory: Migrate the Plugin Transferred notification email to the new Email classes.

See #5351.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-self-transfer.php

    r9703 r10122  
    55use WordPressdotorg\Plugin_Directory\API\Base;
    66use WordPressdotorg\Plugin_Directory\Tools;
     7use WordPressdotorg\Plugin_Directory\Email\Plugin_Transferred_Notification;
    78
    89/**
     
    9192
    9293        // Email all Plugin Committers.
    93         $subject = sprintf( __( '[WordPress Plugin Directory] %s has been transferred.', 'wporg-plugins' ), $plugin->post_title );
    94         $message = sprintf(
    95             /* translators: 1: Author name 2: Date, 3: Plugin Name, 4: New Owners name, 5: Plugin team email address. */
    96             __( 'As requested by %1$s on %2$s, the ownership of %3$s in the WordPress Plugin Directory has been transferred to %4$s.
    97 
    98 If you believe this to be in error, please email %5$s immediately.
    99 
    100 --
    101 The WordPress Plugin Directory Team
    102 https://make.wordpress.org/plugins', 'wporg-plugins' ),
    103             wp_get_current_user()->display_name,
    104             gmdate( 'Y-m-d H:i:s \G\M\T' ),
    105             $plugin->post_title,
    106             $new_owner->display_name . ' (' . $new_owner->user_login . ')',
    107             'plugins@wordpress.org'
     94        $email = new Plugin_Transferred_Notification(
     95            $plugin,
     96            Tools::get_plugin_committers( $plugin->post_name ),
     97            [
     98                'owner' => $new_owner
     99            ]
    108100        );
    109 
    110         $who_to_email = [];
    111         foreach ( Tools::get_plugin_committers( $plugin->post_name ) as $user_login ) {
    112             $who_to_email[] = get_user_by( 'login', $user_login )->user_email;
    113         }
    114 
    115         wp_mail( $who_to_email, $subject, $message, 'From: plugins@wordpress.org' );
     101        $email->send();
    116102
    117103        $result['transferred'] = true;
Note: See TracChangeset for help on using the changeset viewer.