Skip to contents

Retrieve the latest download activity for real-time dashboards or to identify hot leads for immediate follow-up. Use this to build admin dashboards showing recent engagement, or to extract investor leads for sales team follow-up. Optionally filter to specific user types.

Usage

get_recent_downloads(limit = 50, user_type = NULL, cn = NULL)

Arguments

limit

Integer. Maximum number of records to return (default: 50). Valid range: 1 to 500. Use smaller limits for dashboard widgets, larger limits for batch export to CRM systems.

user_type

Character string or NULL. Filter to specific user type (optional). Valid values: "artist", "investor", "other". If NULL (default), returns all user types mixed together.

cn

DBI connection object or NULL. Database connection from artcore::dbc("artsite"). If NULL (default), creates and closes connection automatically.

Value

Data frame with recent download records containing all fields: id, email, user_type, user_id, ip_address, user_agent, downloaded_at. Ordered by downloaded_at descending (most recent first). Returns empty data frame if no downloads found.

Examples

if (FALSE) { # \dontrun{
# Get the 20 most recent downloads
recent <- get_recent_downloads(limit = 20)

# Get recent investor downloads for sales follow-up
investor_leads <- get_recent_downloads(
  limit = 50,
  user_type = "investor"
)
} # }