π§ 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 β
- Navigate to Settings β Forward Emails.
- Click New Configuration.
- 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)
- Configuration Name β e.g.,
- 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 β
- Open your test and add a new step: EXTRACT_EMAIL_CONTENT.
- Select the Forward Email Configuration you created earlier.
- Choose the Extraction Type β one of:
- Verification Code β extracts numeric codes
- Output variable:
email_otp_code
- Output variable:
- Activation Link β extracts a link (e.g., a login or verification URL)
- Output variable:
email_magic_link
- Output variable:
- Custom β extracts any text based on a custom instruction
- Output variable:
email_extracted_content
- Output variable:
- Verification Code β extracts numeric codes
- (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.β
- 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 $.emailAt 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 Type | Variable Name | Description |
|---|---|---|
| Verification Code | email_otp_code | The numeric verification code extracted from the email. |
| Activation Link | email_magic_link | The link (URL) extracted from the email body. |
| Custom | email_extracted_content | The 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:Or simply describe it in your test steps as βuse the content extracted from the email.β
input email_extracted_content into text input field
5. Example Scenario β
Goal: Automatically complete a login flow using a magic link received by email.
- Create a Forward Email Configuration for sender
@notification.shiplight.ai. - Add a test step: EXTRACT_EMAIL_CONTENT
- Extraction Type: Activation Link
- Output Variable:
email_magic_link
- Add a NAVIGATE step:
navigate to email_magic_link - 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_contentThis 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) β
- Go to Settings β See all settings β Forwarding and POP/IMAP.
- Click Add a forwarding address.
- Enter your generated Shiplight forwarding email (e.g.,
xxxx@forward.shiplight.ai). - Gmail will send a verification email β you can skip actual verification for test accounts or complete it via test flow.
- After adding, select Forward a copy of incoming mail to... and choose whether to keep or delete Gmail copies.
- Save changes.
Optional: Use Gmail filters to forward only specific messages (e.g., from @notification.shiplight.ai).
π΅ Outlook / Microsoft 365 β
- Go to Settings β View all Outlook settings β Mail β Rules.
- Add a new rule:
- Condition: From contains
@notification.shiplight.ai - Action: Forward to
xxxx@forward.shiplight.ai
- Condition: From contains
- Save the rule.
- Make sure forwarding is enabled for your account (check admin policy if needed).
π£ Yahoo Mail β
- Go to Settings β More Settings β Mailboxes.
- Select your account, scroll to Forwarding, and add your Shiplight forward address.
- Confirm via Yahooβs verification email.
- 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 Emailto 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 β
| Step | Description |
|---|---|
| 1. Create Forward Config | Generate a forwarding email address in Settings β Forward Emails. |
| 2. Add Extraction Step | Add EXTRACT_EMAIL_CONTENT and select extraction type. |
| 3. Use Variables | Reference the output variable in later steps. |
| 4. Dynamic Filters | Use $ or $. variables for dynamic subjects or recipients. |
| 5. LLM Extraction | No regex required β the system understands and extracts intelligently. |
| 6. Email Setup | Configure your email provider to forward test emails to Shiplight. |
10. Quick Reference: Variables β
| Extraction Type | Variable Name | Example Use |
|---|---|---|
| Verification Code | email_otp_code | input email_otp_code into verification code input field |
| Activation Link | email_magic_link | navigate to email_magic_link |
| Custom | email_extracted_content | input email_extracted_content into text input field |