Making WordPress.org

Changeset 12307


Ignore:
Timestamp:
12/08/2022 01:08:44 AM (19 months ago)
Author:
dd32
Message:

HelpScout: When a displayed email has a customer assigned, and that customer has multiple emails assigned, try looking up their WordPress.org email address by those alternates.

This is common when plugin authors use an email forwarder such as me@company but email us from me.company@gmail.

Location:
sites/trunk/api.wordpress.org/public_html/dotorg/helpscout
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/common.php

    r12297 r12307  
    3737    ) {
    3838        $user = get_user_by( 'slug', $m[1] );
     39    }
     40
     41    // If the customer object has alternative emails listed, check to see if they have a profile.
     42    if ( ! $user && ! empty( $request->customer->emails ) ) {
     43        foreach ( $request->customer->emails as $alt_email ) {
     44            $user = get_user_by( 'email', $alt_email );
     45            if ( $user ) {
     46                break;
     47            }
     48        }
    3949    }
    4050
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/profile.php

    r11946 r12307  
    1919        $html .= '<p>Profile: <a href="https://profiles.wordpress.org/' . $user->user_nicename . '/">'. $user->user_nicename .'</a></p>';
    2020        $html .= '<p>Forums: <a href="https://wordpress.org/support/users/'. $user->user_nicename . '/">'. $user->user_nicename .'</a></p>';
     21
     22        // When the Displayed account email doesn't match the email being displayed, output the user email address too.
     23        if ( ! empty( $request->customer->email ) && $request->customer->email !== $user->email ) {
     24            $html .= '<p>Account Email: ' . esc_html( $user->user_email ) . '</p>';
     25        }
    2126    } else {
    2227        $html .= '<p>No profile found</p>';
Note: See TracChangeset for help on using the changeset viewer.