Skip to content

πŸ“§ Email Content Extraction β€” User Guide ​

Overview ​

The Email Content Extraction feature allows your automated tests to automatically read incoming emails and extract specific content β€” such as verification codes, activation links, or any custom information.

This process is powered by an LLM-based extractor, which understands natural language and automatically identifies the required content β€” no regex or complex setup needed.

1. Create a Forward Email Configuration ​

  1. Navigate to Settings β†’ Forward Emails.
  2. Click New Configuration.
  3. Fill in the following fields:
    • Configuration Name β€” e.g., test user forward
    • Forward Email β€” an auto-generated address (e.g., xxxx@forward.shiplight.ai)
    • Filter From Email β€” the sender’s domain or address (e.g., @notification.shiplight.ai)
  4. Click Save.

πŸ’‘ Tip:
This generated email address will receive forwarded test emails.
Make sure your mail provider or automation flow forwards messages to this address. See Common Email Forwarding Configurations for setup instructions.

2. Configure Email Extraction in a Test Case ​

  1. Open your test and add a new step: EXTRACT_EMAIL_CONTENT.
  2. Select the Forward Email Configuration you created earlier.
  3. Choose the Extraction Type β€” one of:
    • Verification Code β†’ extracts numeric codes
      • Output variable: email_otp_code
    • Activation Link β†’ extracts a link (e.g., a login or verification URL)
      • Output variable: email_magic_link
    • Custom β†’ extracts any text based on a custom instruction
      • Output variable: email_extracted_content
  4. (Optional) For Custom type, fill in the Prompt field with a short natural language description of what you want, e.g.:

    β€œExtract the temporary password from the email body.”

  5. Configure filters:
    • Filter From Email β€” required sender address or domain.
    • Filter To Email, Filter Subject, Filter Body Contains β€” optional filters to narrow down the target email.

3. Dynamic Variable Support in Filters ​

All filter fields support referencing variables defined in your test case.
Use variables to dynamically filter based on runtime values.

Syntax ​

  • $variableName
  • $.variableName

Example ​

Filter Subject: Welcome $username
Filter Body Contains: Code sent to $.email

At runtime, $username and $.email will be replaced with the actual test variable values.

4. Using Extracted Results in Tests ​

When an email is matched and processed, the extracted result is automatically stored in a variable depending on the Extraction Type.

Extraction TypeVariable NameDescription
Verification Codeemail_otp_codeThe numeric verification code extracted from the email.
Activation Linkemail_magic_linkThe link (URL) extracted from the email body.
Customemail_extracted_contentThe text or content extracted based on the custom prompt.

You can reference these variables directly in later steps of your test.

Example Usages ​

  • Navigate to an activation link:
    navigate to email_magic_link
  • Input a verification code:
    input email_otp_code into verification code input field
  • Use custom extracted content:
    input email_extracted_content into text input field
    Or simply describe it in your test steps as β€œuse the content extracted from the email.”

5. Example Scenario ​

Goal: Automatically complete a login flow using a magic link received by email.

  1. Create a Forward Email Configuration for sender @notification.shiplight.ai.
  2. Add a test step: EXTRACT_EMAIL_CONTENT
    • Extraction Type: Activation Link
    • Output Variable: email_magic_link
  3. Add a NAVIGATE step:
    navigate to email_magic_link
  4. Run the test.
    The test automatically waits for the forwarded email, extracts the link, and navigates to it to complete login.

6. Example UI Reference ​

Step 1: EXTRACT_EMAIL_CONTENT
β†’ custom
β†’ From: @notification.shiplight.ai
β†’ Variable: email_extracted_content

Step 2: NAVIGATE
β†’ navigate to email_extracted_content

This setup extracts custom text from the email and uses it directly in the next action.

7. Common Email Forwarding Configurations ​

Here's how to configure forwarding from popular email services to your Shiplight Forward Email address (e.g., xxxx@forward.shiplight.ai).

🟒 Gmail (Google Mail) ​

  1. Go to Settings β†’ See all settings β†’ Forwarding and POP/IMAP.
  2. Click Add a forwarding address.
  3. Enter your generated Shiplight forwarding email (e.g., xxxx@forward.shiplight.ai).
  4. Gmail will send a verification email β€” you can skip actual verification for test accounts or complete it via test flow.
  5. After adding, select Forward a copy of incoming mail to... and choose whether to keep or delete Gmail copies.
  6. Save changes.

Optional: Use Gmail filters to forward only specific messages (e.g., from @notification.shiplight.ai).

πŸ”΅ Outlook / Microsoft 365 ​

  1. Go to Settings β†’ View all Outlook settings β†’ Mail β†’ Rules.
  2. Add a new rule:
    • Condition: From contains @notification.shiplight.ai
    • Action: Forward to xxxx@forward.shiplight.ai
  3. Save the rule.
  4. Make sure forwarding is enabled for your account (check admin policy if needed).

🟣 Yahoo Mail ​

  1. Go to Settings β†’ More Settings β†’ Mailboxes.
  2. Select your account, scroll to Forwarding, and add your Shiplight forward address.
  3. Confirm via Yahoo’s verification email.
  4. Save.

🟠 Custom / Corporate Mail Servers (e.g., Exchange, Zoho, or Company Domain) ​

You can usually add a forwarding rule via:

  • Mail routing rules in admin settings, or
  • User-level forwarding in account preferences.

Typical configuration:

  • Condition: From contains @notification.shiplight.ai
  • Action: Forward to xxxx@forward.shiplight.ai
  • Keep a copy: Optional depending on test needs.

8. Best Practices ​

  • Always filter by sender using Filter From Email to prevent unrelated messages from being processed.
  • Use test variables ($, $.) to dynamically adjust filters like subject or body content.
  • Keep prompts clear and concise when using β€œCustom” extraction β€” LLMs perform best with specific instructions.
  • Avoid forwarding sensitive production data; use only test environments or mock email accounts.
  • Create separate configurations for different types of emails (sign-up, reset, notifications, etc.) for easier maintenance.

9. Summary ​

StepDescription
1. Create Forward ConfigGenerate a forwarding email address in Settings β†’ Forward Emails.
2. Add Extraction StepAdd EXTRACT_EMAIL_CONTENT and select extraction type.
3. Use VariablesReference the output variable in later steps.
4. Dynamic FiltersUse $ or $. variables for dynamic subjects or recipients.
5. LLM ExtractionNo regex required β€” the system understands and extracts intelligently.
6. Email SetupConfigure your email provider to forward test emails to Shiplight.

10. Quick Reference: Variables ​

Extraction TypeVariable NameExample Use
Verification Codeemail_otp_codeinput email_otp_code into verification code input field
Activation Linkemail_magic_linknavigate to email_magic_link
Customemail_extracted_contentinput email_extracted_content into text input field

Released under the MIT License.