Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Report email stats enhacement #7214
Please be sure you are submitting this against the staging branch.
This PR change logic to generate email stats (Data Source: Email).
Before update the emails are listed with date_added limit and numbers (sent, read, unsubscribed) are loaded global for all period. This a lot of users make confused.
With enabled Hide date range SQL use the global dat from emails table (sent_count, read_count ...)
Steps to test this PR:
List deprecations along with the new alternative:
List backwards compatibility breaks:
npracht left a comment
I think there is an issue, i'm running the creation of a new report on a DB with data and the creation of the report is running still running for ages.
SELECT SUM(DISTINCT e.sent_count) as sent_count, SUM(DISTINCT e.read_count) as read_count, count(CASE WHEN dnc.id and dnc.reason = 1 THEN 1 ELSE null END) as unsubscribed, count(CASE WHEN dnc.id and dnc.reason = 2 THEN 1 ELSE null END) as bounced FROM emails e LEFT JOIN emails vp ON vp.id = e.variant_parent_id INNER JOIN email_stats es ON e.id = es.email_id LEFT JOIN categories c ON c.id = e.category_id LEFT JOIN (SELECT COUNT(cut2.channel_id) AS trackable_count, SUM(cut2.hits) AS hits, SUM(cut2.unique_hits) AS unique_hits, cut2.channel_id FROM channel_url_trackables cut2 WHERE cut2.channel = 'email' GROUP BY cut2.channel_id) cut ON e.id = cut.channel_id LEFT JOIN lead_donotcontact dnc ON e.id = dnc.channel_id AND dnc.channel='email' WHERE es.date_sent IS NULL OR (es.date_sent BETWEEN '2019-01-05 23:00:00' AND '2019-02-06 09:09:14')