APIs & Integrations

darius_veracity
Member

Sync emails to/from web app

Hello,

 

We have web application which has email sending functionality. We store emails in database. We use services like mailgun. Can we sync those emails somehow to hubspot?

 

And also can we sync emails from hubspot to our application? 

 

I checked webhooks  but looks like it cannot be done using them.

Also did not not see a documention how to sync emails from our database to hubspot.

 

If those are possible, then how?

0 Upvotes
3 Replies 3
WendyGoh
HubSpot Employee
HubSpot Employee

Sync emails to/from web app

Hey @darius_veracity,

 

By emails do you mean the sales email? If so, you can create email engagement via the Create an Engagement | Engagements API. You can also get email engagements via the Get all engagements | Engagements API

 

For now, there's no Webhooks for engagements and the best way is to poll it through the endpoints that I shared above. 

0 Upvotes
darius_veracity
Member

Sync emails to/from web app

I was thinking about all emails. I will try to ask a guy who created a task also. What else emails are there? What is the definition of sales email? 

 

How in UI those engagament emails (sales emails) are accessed? Through Conversations > Inbox ?

 

If I create the engagement email, it will not be sent? I imagine if we want to sync emails sent to hubspot, I could user create api endpoint https://legacydocs.hubspot.com/docs/methods/engagements/create_engagement but we do not want to send email repeatedly.

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Sync emails to/from web app

Hey @darius_veracity,

 

By sales email, I mean the one-to-one emails on objects (contacts, companies, deals or tickets) timeline. More details here: Send and reply to one-to-one emails.

 

When creating the email engagements, you'd need to specify the associations on the POST body i.e. this engagement will be associated with contact id 2. 

 

{
    "engagement": {
        "active": true,
        "ownerId": 1,
        "type": "NOTE",
        "timestamp": 1409172644778
    },
    "associations": {
        "contactIds": [2],
        "companyIds": [ ],
        "dealIds": [ ],
        "ownerIds": [ ],
		"ticketIds":[ ]
    },
    "attachments": [
        {
            "id": 4241968539
        }
    ],
    "metadata": {
        "body": "note body"
    }
}

 

Alternatively, you can use the CRM Associations API Overview to associate engagement to an object. 

 

Once the association is done, you can access the engagement on the object's timeline. The email will not be send. This is just for logging purpose. 

0 Upvotes