I am trying to develop a NodeJS program to create email engagements on a client's Hubspot. I have done everything but the creation of the engagement. I have found a sample code of a note engagement but I can't find one for email engagements.
I gather that you found the sample on node tab of the dev docs here.
If you go back to the json and look at the example, scroll down to after the note example and you will see the meta that you need for email. You would replace the note meta that is provided in the node example with the email metadata
Example:
"metadata": {
"from": {
"email": "email@domain.com",
"firstName": "First",
"lastName": "Last"
},
"to": [
{
"email": "contact name <test@test.com>"
}
],
"cc": [],
"bcc": [],
"subject": "This is the subject of the email",
"html": "<div>This is the body of the email</div><div><br></div><div>-Me</div>",
"text": "This is the body of the email\n\n-Me"
}
You can create an email engament with the same api just need to change the object type. consider the following code as an example. var request = require("request");
I gather that you found the sample on node tab of the dev docs here.
If you go back to the json and look at the example, scroll down to after the note example and you will see the meta that you need for email. You would replace the note meta that is provided in the node example with the email metadata
Example:
"metadata": {
"from": {
"email": "email@domain.com",
"firstName": "First",
"lastName": "Last"
},
"to": [
{
"email": "contact name <test@test.com>"
}
],
"cc": [],
"bcc": [],
"subject": "This is the subject of the email",
"html": "<div>This is the body of the email</div><div><br></div><div>-Me</div>",
"text": "This is the body of the email\n\n-Me"
}