Any tips for collecting emails?
# prompt-tip
r
Does anyone have tips for collecting emails on a phone call? I'm using a webhook, and I've tried various transcribers and models. I have the best luck with: - model: gpt-4.1 - transcriber: deepgram / nova-3 However, the collected email is frequently misspelled, even when the user spells out the email letter by letter. Some common errors are similar sounding names and the special character '+' for alias emails: - john+doe@gmail.com ---> john+signdoe@gmail.com - john ---> jon
r
Hi ronnypg, To effectively capture email addresses during phone calls, ensure that your transcription service is configured correctly. You can use structured outputs to handle data extraction, such as email addresses, from calls. Here's a quick overview of how to set up a structured output to extract an email: 1. **Create a Structured Output**: Define a JSON schema for extracting customer information, including emails. - Include an email pattern validation in your schema:
Copy code
json
   {
     "type": "object",
     "properties": {
       "email": {
         "type": "string",
         "format": "email",
         "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
       }
     },
     "required": ["email"]
   }
2. **Attach Structured Output**: Link this output to your assistant so it can automatically extract the information during the call. 3. **Implement and Test**: Conduct a call to see if the setup correctly captures and formats the information. You can start a test call via the Vapi dashboard or API and review extracted data in the Call Logs. For more detailed steps, you can refer to the [Structured Outputs Quickstart](https://docs.vapi.ai/assistants/structured-outputs-quickstart) guide. If the transcription model isn't recognizing the email address correctly, ensure the correct language and model settings in your transcription service. You might also want to explore the enhanced regex support for emails as documented in the [October 29, 2024 update](https://docs.vapi.ai/changelog/2024/10/29). If you have specific configurations or other details to discuss, feel free to reach out again.
r
Thanks, I'll give this a try. However, does structured outputs help with post-call extraction vs. live call? I'm trying to increase the extraction rate for a live call, where the user becomes frustrated after multiple misspellings. My transcription config is:
Copy code
const deepgramTranscriber: Vapi.DeepgramTranscriber = {
  provider: "deepgram",
  model: "nova-3",
  language: "en-US",
  confidenceThreshold: 0.4,
  smartFormat: true,
  numerals: true,
  endpointing: 300,
}
r
Structured outputs is mainly for post-call analysis. For improving extraction during a call, it requires more prompt engineering than anything. Your settings look good for transcription.
r
Thanks for the feedback. Do you have any suggestions for an email capturing prompt? I'll attach my example. I've gotten here after multiple iterations, adding and subtracting other suggestions I've found on this Discord and YouTube.
l
I'd text them a link using Twilio to a form to put in their email
r
Thanks for the help Kyle!
r
Glad you were able to get this resolved. We’ve closed this ticket, but your input is very valuable to us. Please take a moment to complete the survey, which should appear in a couple of days—your feedback directly helps us improve our support.