Since 3.22.0, when ingestion stores a new inbound message from an unclaimed account (including one it has just provisioned, see Accounts for new addresses), it fills that account’s empty profile fields from the person’s own emails (LH_Email_Enrich, includes/class-lh-email-enrich.php, lh-tasks #155601). Automated mail (lists and bulk sends) queues nothing. The work runs in the background on the lh_email_enrich_profile Action Scheduler action, two minutes after the message is stored (lh_email_return_enrich_delay), once per account while one is waiting. The lh_email_return_enrich_enabled filter turns it off.
Only unclaimed accounts are touched: the account must hold the unclaimed role on some site and nothing else on any site, apart from roles other plugins give every account, such as bbPress’s default forum role (lh_email_return_enrich_unclaimed_roles). Every value is written fill-only through LH Profile Page’s field saver, so nothing an account already has is replaced, and each fill is recorded on the account’s audit trail as a Profile details change.
What is read
The account’s 50 most recent stored messages (lh_email_return_enrich_max_messages), spam left out. Only the text the person wrote is used: everything from the first quote marker on is cut (an “On … wrote:” line, From: or Sent: headers, Original or Forwarded message separators, “Sent from my …”, “Get Outlook for”, a long underscore rule), and lines starting with > are dropped. The markers are filterable regular expressions (lh_email_return_enrich_quote_markers).
Phone numbers
- Numbers are found and parsed with libphonenumber through LH Phone Numbers, in its default region.
- A message listing more than two numbers (a team sheet, a forwarded list) contributes none (
lh_email_return_enrich_max_numbers_per_message). - A number another account holds in LH Phone Numbers, or that appears in the own text of anyone else’s mail on the same site, is skipped as the site’s or an officer’s. Up to 25 such messages are checked per number (
lh_email_return_enrich_shared_number_scan_limit, 0 turns the check off). - Since 3.22.2, when an account has given more than one number, only numbers given in at least two of its messages are used (
lh_email_return_enrich_min_messages_per_number), so a teammate’s number mentioned once, or a number in a newsletter, is not taken as theirs. A number that is the only one it has ever given is used. - A person never gets a toll-free, 13, 1300 or premium number (
lh_email_return_enrich_person_excluded_line_types); an organisation may. - Mobiles come first, then the number given most often, then the most recent. The best goes in the empty primary phone and the next in the empty secondary.
Gender
An organisation gets Organisation. For a person, a labelled form value in their own text (“Gender: Female”, labels and values filterable with lh_email_return_enrich_gender_labels and lh_email_return_enrich_gender_values) is used, otherwise LH Profile Page’s conservative first-name helper (LH_Profile_First_Name_Gender, lh-tasks #155600), which gives nothing for a name that could go either way.
An account is an organisation when its address is a role mailbox (info@, sales@, noreply@ and the like), or it has no first or last name and its display name or the name its mail came under has an organisation word in it. Both lists are LH Messaging’s; lh_email_enrich_is_organisation overrides the decision.
Address
Only an organisation’s address is taken, from the last 15 lines of its own text (lh_email_return_enrich_signature_lines): a person’s signature address is usually their workplace. The default pattern reads Australian addresses (“Level 2, 120 Smith Street, Collingwood VIC 3066”); lh_email_return_enrich_address_patterns takes regular expressions with the named groups street, town, state and postcode for other formats. The address is written only when the account has none at all.
Checking and rerunning
The enrich-profile ability reports what an account’s emails would give, each number found with what was decided about it, and which fields fill-only would skip. It is a dry run unless dry_run is false, which fills the empty fields. lh_email_enrich_proposed_values can change the values before they are saved. Names are not set here: see Accounts for new addresses.

