Urgent.News

What's breaking now, across thousands of outlets.

AI

Parsing Property Portal Lead Emails Into Clean Records Before Any AI Touches Them

Many property portals still deliver leads to small agencies as notification emails. Before you add an AI assistant to the follow-up, turn those emails into clean, structured records. Clean input makes everything downstream simpler, from dedupe to follow-up timers. This intake step is the unglamorous start of real estate lead automation for small agencies , and it is worth getting right. The shape…

Property portals often send leads to small agencies via email notifications. Before incorporating AI into the follow-up process, it is crucial to convert these emails into clean, structured records. This initial step, although not glamorous, lays the foundation for efficient lead automation in real estate. The desired format includes fields such as portal name, received timestamp, name, phone number, email, listing reference, message, and raw email ID.

To accommodate different email formats from various portals, each portal requires a dedicated parser. These parsers must be written based on the sender's email address, with routing determined by the "From" header. The parsing process involves utilizing regular expressions to extract relevant information from the email body.

The provided Python code snippet demonstrates a parser for portal A. It defines a function called "parse_portal_a" that takes the email body as input and returns a dictionary containing the extracted details. Regular expressions are used to match specific patterns, such as name, phone number, email, listing reference, and message. If a pattern is found, its corresponding group is extracted and returned after removing any leading or trailing whitespace.

To handle multiple portals, a dictionary called "PARSERS" is created, mapping the sender addresses to their respective parsing functions. When parsing an email, the code retrieves the appropriate parser based on the sender's email address. If no parser is found, the email is routed to a human for further handling.

Before storing the parsed records, validation checks are performed. The code ensures that the required fields, such as listing reference, are present. Additionally, it checks if at least one of the optional fields, such as phone number or email, is provided. If validation fails, the email is sent to a person for review, along with a reason indicating the validation issues.

To maintain flexibility and adaptability, it is essential to store the raw email ID. This allows for re-parsing in case a portal modifies its email format unexpectedly. Additionally, phone numbers should be normalized to a consistent format to facilitate accurate matching against existing contact records. Failure to handle phone numbers correctly can lead to missed follow-ups or miscommunication.

It is crucial to be explicit about validation failures and not rely on silent failures. If a parser fails to extract a phone number, the lead should not be silently discarded but rather directed to a person for manual resolution. This ensures that no lead is left without a viable contact method.

AI should only be employed for processing the free-text message portion of the lead. Tasks such as extracting information like budget, move-in date, or the customer's intent (e.g., "wants to view this weekend") can benefit from AI techniques. These extracted details should be stored in separate fields, preserving the deterministic parsing results while leveraging AI for more complex tasks.

Finally, it is advisable to write tests for each portal using saved real emails, with personal details removed. This ensures that the parsing logic works as expected and handles various email formats consistently. Once the intake step is complete, subsequent processes such as deduplication and follow-up timers become significantly easier, as all leads arrive in a standardized format.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

Letting an AI Agent Drive Ghidra: A Hands-On Test of REA’s 170 MCP Tools, One Recovered Password, and the Limits

Author: Guangyi Zhao Date: 2026-10-13 Subject: morluto/rea (REA: Reverse Engineer Anything), npm package rea-agents 6.4.0, MIT license Environment: Ubuntu 24.04 (Linux x64), Node 24.20; target is an…

  • REA platform enables AI agents to drive Ghidra and other reverse engineering tools.
  • Analysis of small C program with password input and built-in constant.
  • Human intervention required at critical steps despite REA's potential.

HappyGF: I Built an AI Assistant to Make Sure Contractors Get Paid on Friday

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle . What I Built Every Friday, the accountant processes payments to the contractors and suppliers who keep my…

  • Creator built AI assistant HappyGF to ensure contractors get paid on Friday.
  • HappyGF uses Java and open-source The Pipeline Framework (TPF) with Gemma and Tev1 models.

More from Monday 19 October →