Specify the data sent to Intercom API according to event type

def get_intercom_data(self):
        """Specify the data sent to Intercom API according to event type"""
        data = {
            "event_name": self.get_type_display(),  # event type
            "created_at": calendar.timegm(self.created.utctimetuple()),  # date
            "metadata": self.metadata
        }
        if self.user:
            data["user_id"] = self.user.intercom_id
        return data