Is there a way to create a weekly email containing the activity information on the Admin Dashboard page? Primarily the items under Community Health and User Metrics.
You can use Data Explorer to get the data and the automation plugin to send the results of the query as a personal message.
is there no way to do this with stock Discourse? as it already has the visualizations that I need for the information.
I added this CSS to my theme. This will allow you to print the admin dashboard without the sidebar and other unnecessary widgets showing up. In general this makes other pages more printable too. I just printed mine to PDF and I could manually do this every Sunday let’s say in order to store snapshots of my site statistics.
@media print {
#main-outlet-wrapper {
display: block;
}
.sidebar-wrapper, .d-page-header, nav {
display: none;
}
#main-outlet {
width: 100%;
padding: 2em !important;
max-width: unset;
}
}
In terms of automating the print so it could be put in a cron job, so far I have not been successful. Here is an attempt. Currently returns 404, I assume because auth is failing, though I did copy cookies from devtools. Maybe I’m missing some nuance of auth. Also I don’t know if the charts would load properly before the print is triggered.
#!/bin/bash
# Define URL and output filename
DATE=$(date +"%Y-%m-%d")
OUTPUT="${DATE} Site Report.pdf"
DOMAIN="mysite.org"
COOKIES_DB="$HOME/.config/chromium/Default/Cookies"
COOKIES_FILE="./cookies.txt" # copy cookies out of devtools and place here
COOKIE_HEADER=$(cat $COOKIES_FILE)
#echo "$COOKIE_HEADER"
# Run Chrome or Chromium headless to print to PDF
chromium --headless --disable-gpu --print-to-pdf="$OUTPUT" \
--extra-headers="Cookie: $COOKIE_HEADER" \
--extra-headers="Accept: text/html" \
--extra-headers="Accept-Encoding: gzip" \
--extra-headers="Accept-Language: en-US,en;q=0.9" \
"https://$DOMAIN/admin"
echo "Saved to $OUTPUT"