Making WordPress.org


Ignore:
Timestamp:
12/08/2022 01:08:44 AM (3 years 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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.