Skip to contents

Quick lookup to avoid duplicate download prompts or to gate content based on prior engagement. Use this in download flows to personalize the user experience or to show "Welcome back" messages to returning visitors. More efficient than get_downloads_by_email() when you only need a boolean result.

Usage

has_downloaded_whitepaper(email, cn = NULL)

Arguments

email

Character string. Email address to check. Validated using is_valid_email() before query.

cn

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

Value

Logical. TRUE if email has at least one download on record, FALSE if no downloads found. Use this to branch UI logic or personalize messaging.

Examples

if (FALSE) { # \dontrun{
# Personalize download page based on prior engagement
if (has_downloaded_whitepaper(email)) {
  message("Welcome back! Here's the latest version.")
} else {
  message("Enter your email to download the whitepaper.")
}
} # }