#' get user by email address for the API
#'
#' This is a modification of \code{polished::get_user_by_email} to also query
#' only for users that were created by this polished.tech API account.
#'
#' @param conn the database connection
#' @param email the user's email address
#' @param account_uid the account that created the user
#' @param schema the database schema
#'
#' @return a list of user info if the user is found or `NULL`
#'
#' @export
#'
#' @importFrom pool dbGetQuery
#'
get_user_by_email <- function(conn, email, account_uid, schema = "polished") {
pool::dbGetQuery(
conn,
paste0("SELECT * FROM ", schema, ".users WHERE account_uid=$1 AND email=$2"),
params = list(
account_uid,
email
)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.