Adding mailing events (unsub, open, clicks, etc) to API4
I'd like to add mailing events to API4 so we can use them in SearchKit, to improve the A/B Mailing report page, and so on.
This would be all the Mailing Events here. Not sure they are all essential, but might as well do them all at once, as they will all be very similar.
Having poked around at this, I see a few issues that I think I need some help with before starting on this.
We have, for example, TrackableURLOpen, which links to a TrackableURL and also to the Queue entity, which links to the Job entity, which links to the Mailing entity. I don't think we want to have users building queries with joins on all of these entities in SearchKit in order to get useful information back. Ideally, we'd have an entity that has a get action that would return:
- id from TrackableURLOpen
- timestamp from TrackableURLOpen
- URL from TrackableURL
- contact id from Queue
- mailing id from Job
Can we do this by adding all these entities to the API, adding entity bridges to connect them all and then adding an abstract entity that wraps everything up together, with a get function that gets all the fields above from the API (and a getfields function as well). Or is there a less manual way to do this?
Also, I see that the Queue entity already exists in API4, but it isn't the Mailing_Event_Queue entity. Is there a way to specify the full class for an entity so that we don't get a collision? It looks like it just expects the last word from the classname as the API class and that won't work in this case. This might be helpful in general here, because adding an entity called just Opened is going to be confusing (versus naming it something like MailingEventOpened).