APIs & Integrations

prozdev
Participant

Should I use "email" type engagements for general replies on Ticket system?

SOLVE

I like the Tickets center at HubSpot, and I'm trying to recreate something similar. Users have a way to see all their tickets, and click on one to see the conversation stream. For sending a reply and conversing on this tickets page, should these engagements be of type "email"? I'm not seeing any other type that would make sense, but wanted to make sure I'm not missing something. Thanks!

0 Upvotes
1 Accepted solution
cbarley
Solution
HubSpot Alumni
HubSpot Alumni

Should I use "email" type engagements for general replies on Ticket system?

SOLVE

Hi @kakigori, yes, you should use the engagements API, create the email using the type EMAIL per the docs, and associate the engagement with a ticket in the associations object by using the ticket ID you're looking to associate with. Example:

{
    "engagement": {
        "active": true,
        "ownerId": 1,
        "type": "EMAIL",
        "timestamp": 1544196558552
    },
    "associations": {
        "contactIds": [32551],
        "companyIds": [ ],
        "ticketIds": [3338323],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
    "metadata": {
    "from": {
      "email": "email_address@email.com",
      "firstName": "Connor",
      "lastName": "Barley"
    },
    "to": [
      {
        "email": "Derek Test <test@test123.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"
    }
}

View solution in original post

0 Upvotes
3 Replies 3
cbarley
HubSpot Alumni
HubSpot Alumni

Should I use "email" type engagements for general replies on Ticket system?

SOLVE

Hi @kakigori, it just logs the email onto the timeline and does not send the actual email. So, yes -- safe to test!

cbarley
Solution
HubSpot Alumni
HubSpot Alumni

Should I use "email" type engagements for general replies on Ticket system?

SOLVE

Hi @kakigori, yes, you should use the engagements API, create the email using the type EMAIL per the docs, and associate the engagement with a ticket in the associations object by using the ticket ID you're looking to associate with. Example:

{
    "engagement": {
        "active": true,
        "ownerId": 1,
        "type": "EMAIL",
        "timestamp": 1544196558552
    },
    "associations": {
        "contactIds": [32551],
        "companyIds": [ ],
        "ticketIds": [3338323],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
    "metadata": {
    "from": {
      "email": "email_address@email.com",
      "firstName": "Connor",
      "lastName": "Barley"
    },
    "to": [
      {
        "email": "Derek Test <test@test123.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"
    }
}
0 Upvotes
prozdev
Participant

Should I use "email" type engagements for general replies on Ticket system?

SOLVE

@Connor_Barley Thanks for your help and clarification! Does this actually send an email or is it safe for testing?

0 Upvotes