Generating inputs from emails

Inputs are the data extracted from an email according to your defined pattern. They serve as the basis for generating zero-knowledge proofs.

Understanding the Flow

Before we dive into the implementation, let's understand the flow of generating inputs from emails using the ZK Email SDK:

  1. Pattern Definition:

    • You start by defining a pattern in the ZK Email SDK Registry.

    • This pattern specifies what information to extract from emails and how to process it.

  2. Input Worker Initialization:

    • When your application starts, you initialize an input worker for your specific pattern.

    • This worker contains the logic to parse emails according to your pattern.

  3. Email Content Input:

    • Your application provides a way for users to input email content (e.g., a textarea).

  4. Input Generation:

    • When triggered (e.g., by a button click), your application sends the email content to the input worker.

    • The worker processes the email content according to your pattern.

    • It extracts the relevant information and formats it as specified in your pattern.

  5. Result Handling:

    • The generated input is returned to your application.

    • You can then display this input to the user or use it for further processing (e.g., proof generation).

  6. Error Handling:

    • Throughout this process, you need to handle potential errors, such as invalid email content or processing failures.

Step-by-Step Guide

TODO

Last updated