OA
OpsAgent

Clean Email

Last updated 57 minutes ago

The Clean Email workflow action takes an email address from a record property, normalizes it, and validates its format, all in a single step. Optional cleaning behaviors (configured once per portal) can also strip plus-addressing, fix common domain typos, normalize provider aliases, and flag disposable or role-based addresses. Use it to keep your CRM data clean and prevent deliverability issues caused by malformed addresses.

Custom workflow actions need a HubSpot plan that includes workflows (Professional or Enterprise). On any plan, including Free, you can clean an address from the record instead with the Clean Email Card.

How It Works

Add the Clean Email action to any workflow in HubSpot: contacts, companies, deals, tickets, orders, projects, custom objects, or any other object a workflow runs on. The action is not restricted to a specific object type. When a record reaches this step, the app reads the email from the property you selected, applies the base cleaning, layers on any optional behaviors you enabled in the app's settings, checks the format, and returns the results so your workflow can decide what to do next.

The action has a single input: the email address. Everything else about how it cleans is controlled by your portal-level settings, in OpsAgent or in HubSpot under the app's Settings tab, not by per-step options. See the Settings Reference to review and change those behaviors.

Action Inputs

When adding the Clean Email action to your workflow, you configure the following field:

Field Required Description
Email Address Yes The email address property to clean and validate

What the Action Does

The base cleaning always runs, in this order:

  1. Trims whitespace - removes spaces from the beginning and end of the address
  2. Converts to lowercase - normalizes the entire address to lowercase for consistency
  3. Strips invisible characters - removes control and non-printable characters that can hide in copy-pasted text
  4. Removes internal whitespace - deletes any spaces left inside the address
  5. Validates the format - checks that the result is a properly structured email address (has an @ symbol, a valid domain with an extension, no consecutive dots, and only permitted characters)

Depending on your portal settings, the action may then also:

  • Strip plus-addressing - turn user+tag@example.com into user@example.com
  • Fix common typos - correct a known domain misspelling such as gmial.com to gmail.com
  • Normalize the domain - map a provider alias such as googlemail.com to gmail.com and strip a trailing dot
  • Flag disposable & role-based addresses - set output flags for throwaway domains and shared mailboxes without changing the email

These optional behaviors are off by default. See the Settings Reference to enable them.

Action Outputs

After the Clean Email action runs, the following output values are available for use in subsequent workflow steps:

Output Type Description
Cleaned Email Text The normalized version of the email address after cleaning and any enabled behaviors
Is Valid Yes/No Whether the cleaned email passes format validation. Use this to branch your workflow.
Is Disposable Yes/No Whether the domain matches a known disposable/temporary email provider. Only set when "Flag Disposable & Role-Based" is enabled; otherwise No.
Is Role-Based Yes/No Whether the address is a shared or role mailbox (such as info@ or support@). Only set when "Flag Disposable & Role-Based" is enabled; otherwise No.
Success Yes/No Whether the cleaning operation completed without errors
Error Message Text If something went wrong, this contains a description of the problem

Tip: To learn how to use these output values in later workflow actions (e.g., copy to a property, use in branching logic), see Using workflow action outputs in the HubSpot Knowledge Base.

Writing the Cleaned Value Back

The Clean Email action returns outputs but does not change the record itself. To persist the cleaned address, add a subsequent Edit record / Set property value workflow step and set your email property to the Cleaned Email output. This mirrors how OpsAgent's other workflow-action apps work: the action produces the value, and a following step writes it back.

Branching Your Workflow

A common pattern is to add a branch after the Clean Email action based on the Is Valid result:

  • Valid - the email has a correct format. Proceed with your automation (send emails, enroll in sequences, update properties).
  • Invalid - the email has a formatting problem that cleaning could not fix. You might create a task for manual review, send an internal notification, or set a property to flag the record.

If you enabled "Flag Disposable & Role-Based," you can branch on Is Disposable or Is Role-Based in the same way, for example to keep throwaway signups out of a nurture sequence or to route shared mailboxes to a different owner.

Usage Examples

Clean Messy Form Submissions

Contacts often submit forms with extra spaces or inconsistent casing, and the address JOHN.DOE@EXAMPLE.COM should end up as john.doe@example.com.

  1. Trigger your workflow when a contact submits a form
  2. Add the Clean Email action and select the contact's Email property
  3. Add a Set property value step to write Cleaned Email back to the Email property
  4. Branch on Is Valid: continue your welcome sequence for valid emails, or create a review task for invalid ones

Catch Typos and Provider Aliases Before Sending

An address like jane@gmial.com (a misspelling) or jane@googlemail.com (a provider alias) can slip through import and cause bounces or duplicates.

  1. In the app's Settings, enable Fix Common Typos and Normalize Domain
  2. Add the Clean Email action to a workflow that runs on contact creation
  3. Write Cleaned Email back to the Email property with a Set property value step: jane@gmial.com is corrected to jane@gmail.com, and jane@googlemail.com is normalized to jane@gmail.com

Filter Out Disposable and Role-Based Signups

You want to keep throwaway addresses (like test@mailinator.com) and shared mailboxes (like info@company.com) out of your sales cadence.

  1. In the app's Settings, enable Flag Disposable & Role-Based
  2. Add the Clean Email action early in your enrollment workflow
  3. Branch on Is Disposable and Is Role-Based: route those records to a review list, and let genuine individual addresses continue into your outreach

Tips

  • Use it early in your workflows. Place the Clean Email action near the beginning of a workflow so all downstream steps benefit from the cleaned data.
  • Add a write-back step. The action returns a Cleaned Email output but does not modify the record. Follow it with a Set property value step to store the cleaned address.
  • Works with any email property. You are not limited to the default Email field: you can clean custom email properties or email addresses stored on companies, deals, tickets, orders, projects, and custom objects.
  • Validation catches structure, not existence. The action checks whether the email is formatted correctly. It does not verify whether the mailbox actually exists or can receive mail.
  • Curated lists are not exhaustive. Typo correction, disposable detection, and role-based detection each rely on curated lists that cover the common cases, not every possibility.
Previous
Use Cases