Block reference / Online services
Read email
Wait for an email in a mailbox and take the code, the link or the text out of it.
In both apps
WarpX Browser
WarpX Phone
Use Read email after a sign-up or a sign-in that sends a code or a confirmation link: the block opens the account's mailbox over IMAP, waits for the email to arrive, and hands on the six-digit code or the link in it. It finds the newest email that fits your filters, checks again every five seconds until it turns up, and leaves by its fallback output if it never does. It needs the WarpX Browser desktop app.
Settings
- Mail provider
Fills in the IMAP server for you: Gmail, Outlook / Hotmail, Yahoo, Yandex, iCloud, Zoho, GMX, Rambler, or Other (IMAP server) to type it yourself. Choosing Outlook / Hotmail switches the sign-in to a refresh token.
ExampleGmail- IMAP serverwhen Mail provider is Other (IMAP server)
The mail server's IMAP address, such as
imap.mail.example.com. Always over TLS.Exampleimap.example.com- Portwhen Mail provider is Other (IMAP server)
The IMAP port.
993for almost every server.Example993- Email address
The mailbox to read, and the user name it signs in with. Usually a reference to the profile's own account, such as
{{variables.email}}.Example{{variables.email}}- Sign in withwhen Mail provider is Outlook / Hotmail
Refresh token (OAuth2) or Password. Microsoft no longer accepts a password over IMAP, so keep the refresh token unless your server says otherwise.
ExampleRefresh token (OAuth2)- Refresh tokenwhen Mail provider is Outlook / Hotmail and Sign in with is Refresh token (OAuth2)
The account's OAuth2 refresh token, the long string starting
M.C5…or0.A…. Accounts bought in bulk usually come asemail|password|refresh_token|client_id: this is the third part.Example{{variables.refreshToken}}- Client IDwhen Mail provider is Outlook / Hotmail and Sign in with is Refresh token (OAuth2)
The app the refresh token was issued to, a GUID. In a bulk line it is the fourth part. A token only works with the client ID it came with.
Example9e5f94bc-e8a4-4e73-b8be-63364c29d753- Passwordwhen the provider signs in with a password (every provider but Outlook / Hotmail, which can choose it under Sign in with)
For Gmail, Yahoo, iCloud and Zoho, an app password, not the account password: those providers refuse the normal one over IMAP. Generate it in the account's security settings (for Gmail, 2-Step Verification must be on). Other providers take the normal password. Keep it in Databases → Credentials.
Example{{secrets.gmailAppPassword}}- From contains
Under Which email. Only emails whose sender contains this, ignoring letter case. Part of an address works, such as
shop.example.com. Empty means any sender.Example[email protected]- Subject contains
Only emails whose subject contains this, ignoring letter case. Empty means any subject.
Exampleverification code- Body contains
Only emails whose text contains this, ignoring letter case. Useful when one sender sends several kinds of email.
Example- Folders
The folders to look in, separated by commas, in that order.
INBOXalone on a new block. A code often lands in spam: that folder is[Gmail]/Spamon an English-language Gmail account andJunkon Outlook. A folder the account does not have is skipped without an error.ExampleINBOX, [Gmail]/Spam- Received in the last (minutes)
Ignores older emails, so yesterday's code is not typed today.
10on a new block.0means no minute limit, but only about the last day's mail is searched.Example10- Wait up to (seconds)
How long to keep checking for the email, every five seconds.
60on a new block, at most600.0checks once.Example90- Only unread emails
Skips emails already marked as read. Together with Mark the email as read, a code is never used twice.
ExampleUnchecked- Take from it
A code takes the first number of four to eight digits, from the subject first and then the text. A link takes the first link. A regular expression match takes what your expression matches. The whole text takes the email's text. An email that has none of it is passed over, and the block keeps looking.
ExampleA code- Code pattern (optional)when Take from it is A code
A regular expression for the code when the default catches the wrong number, such as an order number.
\b(\d{6})\btakes six digits only. The first group in brackets is what you get.Example\b(\d{6})\b- Link contains (optional)when Take from it is A link
A regular expression the link must match, so the confirmation link is taken rather than the logo's or the unsubscribe link.
verify|confirmtakes the first link containing either word.Exampleverify|confirm- Regular expressionwhen Take from it is A regular expression match
Searched in the subject, the text and the HTML, ignoring letter case. The first group in brackets is what you get, or the whole match if there is none.
/…/with flags works too.ExampleYour PIN: (\w+)- Mark the email as read
Marks the email the value came from as read. On for a new block.
ExampleChecked- Delete the email afterwards
Deletes the email the value came from, so the mailbox does not fill up over many runs.
ExampleUnchecked- Assign to variable
Keeps the value in a variable. On for a new block.
ExampleChecked- Variable namewhen Assign to variable is ticked
The variable that receives the code, the link or the text.
emailCodeon a new block.ExampleemailCode- Insert to table
Also writes the value into a column of the workflow's table. Offered only when the workflow has table columns.
ExampleUnchecked- Select columnwhen Insert to table is ticked
The column that receives the value.
Examplecode
Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.
What it hands on
When an email turns up, the code, link or text goes to the variable you named ({{variables.emailCode}}), to the table column if you chose one, and on as {{prevBlockData}}. The log line names the email, such as "Your verification code" from Shop <[email protected]>, and the block leaves by its top output. When nothing turns up within Wait up to (seconds), it leaves by its fallback output with No matching email within 90s; with no fallback connected, the run stops with that error.
Example: Sign up, read the code from Gmail and type it
- Start
- Open URL
- Forms
- Click element
- Read email
- Type text
- Click element
- In the Gmail account, turn on 2-Step Verification, then create an app password at
myaccount.google.com/apppasswords. Save it in Databases → Credentials asgmailAppPassword. - Add Open URL with
https://shop.example.com/signup, fill the form with Forms using{{variables.email}}, and Click element on Create account. - Add Read email. Leave Mail provider on Gmail, set Email address to
{{variables.email}}and Password to{{secrets.gmailAppPassword}}. - Set From contains to
[email protected], Subject contains toverification code, and Folders toINBOX, [Gmail]/Spam. - Keep Received in the last (minutes) at
10, set Wait up to (seconds) to90, and leave Take from it on A code with Code pattern (optional)\b(\d{6})\b. - Add Type text on the code field with Text to type
{{variables.emailCode}}, then Click element on Verify. - From the fallback output, add Telegram with
No code for {{variables.email}}so you hear about the profiles that got stuck. - Run it. The log shows
"Your verification code" from Shop <no-reply@…>, and the code is typed in a few seconds after it arrives.
Good to know
- Desktop app only. A browser extension cannot open a mailbox, so the block is not offered in the extension's block list, and an imported workflow that has one fails with a message saying so.
- The mailbox is opened from this computer, not through the profile's proxy. The mail provider sees your own connection, as it does when you read your mail.
- Outlook and Hotmail: a refresh token stops working if the account's password is changed or the token is unused for about 90 days. The block then fails with
Microsoft refused the refresh token:and Microsoft's reason. - A wrong password or app password fails with
Could not sign in to imap.gmail.com:and the server's reason. That is an error, not the fallback: the fallback is only for an email that never came. - Only the 30 newest emails per folder that pass From contains and Subject contains are opened on each check. Tight filters make the block both faster and more accurate.
- With many profiles sharing one catch-all mailbox, put something unique to the profile in Body contains, such as
{{variables.email}}, so each profile takes its own code.
See also
- Type text — Put text into an input, textarea or editable element.
- OTP input — Type a one-time code into a row of boxes that take one character each.
- Get OTP — Work out the current 6-digit two-factor code from its secret.
- Telegram — Send a message, a picture or both to a Telegram chat, group or channel with your own bot.