Retrieves the contact email address used in the User-Agent header for
OpenAlex requests. The value is taken from the environment variable
openalexR.mailto if set; otherwise it falls back to the R option
openalexR.mailto. If neither is defined, NULL is returned.
Details
This helper mirrors the behavior of openalexR::oa_email() to make it easy
to configure a contact address without a hard dependency. Supplying a valid
email helps with responsible API usage.
Examples
Sys.setenv(openalexR.mailto = "name@example.org")
oap_mail()
#> [1] "name@example.org"
options(openalexR.mailto = "name@example.org")
oap_mail()
#> [1] "name@example.org"