Configure onEmailConversationCreate, onEmailConversationUpdate, and onEmailConversationDelete

Marketplace Platform v2.3 deprecation:We’re continuing to improve the Marketplace Platform to deliver stronger security, better performance, and new capabilities. As part of this evolution, Marketplace Platform v2.3 will be deprecated. To learn the dates and next steps, see Migration guide.

onEmailConversationCreate

When an email is sent from the Freshsales Suite system to a contact or received into the Freshsales Suite system from a contact, the onEmailConversationCreate event is triggered and the registered callback method is executed.

Subscribe to the onEmailConversationCreate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onEmailConversationCreate": {
    "handler": "onEmailConversationCreateCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onEmailConversationCreateCallback: function(payload) {
  console.log("Logging arguments from onEmailConversationCreate event: " + JSON.stringify(payload));
  }
}

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggered the onEmailConversationCreate event in the Freshsales Suite system.

  • associationsobject

    All associated objects of the email conversation object, which specify additional information pertaining to the conversation.

  • email_conversationobject

    Information pertaining to an email conversation that is initiated from the Freshsales Suite system.

onEmailConversationUpdate

The onEmailConversationUpdate event is triggered when,

  • The email is opened if the email tracking is enabled.
  • The link(s) added to the email is clicked if the email tracking is enabled.
  • A reply is sent to a message or a new message is added to the email conversation.

Subscribe to the onEmailConversationUpdate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onEmailConversationUpdate": {
    "handler": "onEmailConversationUpdateCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onEmailConversationUpdateCallback: function(payload) {
  console.log("Logging arguments from onEmailConversationUpdate event: " + JSON.stringify(payload));
  }
}

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggered the onEmailConversationUpdate event in the Freshsales Suite system.

  • associationsobject

    All associated objects of the email conversation object, which specify additional information pertaining to the conversation updated.

  • changesobject

    Information pertaining to the changes that triggered the onEmailConversationUpdate event, specified as a JSON object of the following format:

    "changes": {
      "misc_changes": {},
      "model_changes": {
       //For non-array attributes
        "<email_conversation.attribute that changed>": ["Old value", "New value"]
        //For array attributes
        "<email_conversation.array attribute that changed>": [["Old array"], ["New array"]]
      },
      "system_changes": {}
    }
  • email_conversationobject

    Information pertaining to an email conversation that is updated in the Freshsales Suite system.

onEmailConversationDelete

The onEmailConversationDelete event is triggered when,

  • There is a hard delete request for the email conversation from the Freshsales Suite system.
  • An email conversation is deleted from trash automatically after 30 days.

Subscribe to the onEmailConversationDelete event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onEmailConversationDelete": {
    "handler": "onEmailConversationDeleteCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onEmailConversationDeleteCallback: function(payload) {
  console.log("Logging arguments from onEmailConversationDelete event: " + JSON.stringify(payload));
  }
}

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggered the onEmailConversationDelete event in the Freshsales Suite system.

  • associationsobject

    All associated objects of the email conversation object, which specify additional information pertaining to the conversation deleted.

  • email_conversationobject

    Information pertaining to an email conversation that is deleted from the Freshsales Suite system.