Skip to contents

Usually to be called by a scheduler, e.g. cron. If the provided day of year matches those of the config the report is run as otherwise specified in config. Functions called upon are expected to return a character string providing a path to a file that can be attached to an email or, in case of a bulletin, the email body itself. For bulletins, files cannot be attached. The email itself is prepared and sent to recipients defined in the config

Usage

runAutoReport(
  dayNumber = as.POSIXlt(Sys.Date())$yday + 1,
  type = c("subscription", "dispatchment"),
  dryRun = FALSE
)

Arguments

dayNumber

Integer day of year where January 1st is 1. Defaults to current day, i.e. as.POSIXlt(Sys.Date())$yday + 1 (POSIXlt yday is base 0)

type

Character vector defining the type of reports to be processed. May contain one or more of c("subscription", "dispatchment", "bulletin"). Defaults value set to c("subscription", "dispatchment").

dryRun

Logical defining if emails are to be sent. If TRUE a message with reference to the payload file is given but no emails will actually be sent. Default is FALSE

Value

Emails with corresponding file attachment. If dryRun == TRUE just a message

Examples

# \donttest{
# Example depend on environment variable R_RAP_CONFIG_PATH being set
runAutoReport()
#> Auto report data were upgraded: auto reports with no type defined now set to 'subscription'.
#> Auto report data were upgraded: auto reports with no owner name defined now set to an empty string.
#> Auto report data were upgraded: function params list un-nested. Please check that autor reports for registries are still working as expected.
# }