Emails by owner
Retrieves the number of emails sent by each owner in HubSpot by joining the engagements and owners tables and grouping the results by owner.
- Grain
- See the notes
- Built from
- 2Raw tables
- 1Core
- 1Analytics
- Reads from HubSpot
- engagementsowners
- Ships as
- Weld and dbt SQL, open source on GitHub
1-- core.hubspot.emails_by_owner
2-- Emails by owner. Retrieves the number of emails sent by each owner in HubSpot by
3-- joining the engagements and owners tables and grouping the results by owner.
4--
5-- From the weld.app template library. Not reconciled against HubSpot;
6-- check the output against the source before relying on it.
7
8select
9concat(owners.firstName, ' ', owners.lastName) as owner
10, count(*) as emails
11from
12{{raw.hubspot.engagements}} as engagements
13left join {{raw.hubspot.owners}} as owners on cast(owners.id as integer) = engagements.ownerId
14where
15type = 'EMAIL'
16group by ownerThis model and the 1 it depends on. Deploy them together; refs like {{staging.…}} resolve to the matching folders in Weld, and the dbt view uses source() and ref().
How it counts. And where it stops.
This SQL model allows you to easily retrieve the number of emails sent by each owner in your HubSpot account. By joining the engagements and owners tables, this SQL template creates a comprehensive report that includes the first and last name of each owner, as well as the total number of emails they have sent. This information can be used to gain insights into the performance of your sales team, identify top performers, and optimize your email marketing strategy. With the Emails by Owner SQL template, you can quickly and easily analyze your email engagement data and make data-driven decisions to improve your business.
Raw tables it reads
- raw.hubspot.engagements
- raw.hubspot.owners
Put HubSpot in front
of your agents.
Connect HubSpot, deploy the models, and ask questions in Claude, Cursor or ChatGPT. Free for 14 days, no credit card.