New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add calculated fields to API 4 for total mailing stats #26689
Add calculated fields to API 4 for total mailing stats #26689
Conversation
(Standard links)
|
@colemanw could you take a look at this? |
Nice work @larssandergreen
Not quite in the way you mean, there are no user-params passed into a field, however more than one field could share a I noticed one thing that makes them not identical is that some filter out
I think the performance cost is negligible as it doesn't even have to instantiate the objects just read a static variable from them. OTOH, it's kind of pointless as those table names will never change. I don't have any objection to hard-coding them into the queries. |
b733ab7
to
e223d29
Compare
Thanks @colemanw, that's very helpful. Now covers all the stats! |
Regarding |
OK that makes sense about |
df2fc79
to
b6f532d
Compare
b6f532d
to
695d787
Compare
Yes, I should have just added tests from the start — because it wasn't perfect. Should be better now. |
Nice! |
Overview
This adds calculated fields to API 4 for mailing stats (intended recipients, successful deliveries, unique and total opens, unique and total clicks, bounces, unsubscribes, opt outs, forwards, replies). This is mostly copy-paste from the API 3 version, with a little finessing and then combined into one function for most of the mailing events.
I thought I'd put these up as one PR and then finish up the rest afterwards, as I have a couple questions:1. Is there any way to pass a parameter into the method insetSqlRenderer
? Then some of these could be re-used for other stats. For example,countUnsubscribes
could take anorg_unsubscribe
param so that it could also be used for optouts withorg_unsubscribe = 1
. Similarly, we could do distinct and non-distinct click counts with a param.2. I've copy-pasted->getTableName
from API 3, but I wonder if this is worth the cost to load all these classes versus just hardcoding the table names.