-
Notifications
You must be signed in to change notification settings - Fork 4
/
email_authors.Rd
65 lines (58 loc) · 2.28 KB
/
email_authors.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/email_authors.R
\name{email_authors}
\alias{email_authors}
\title{Write an email to project authors}
\usage{
email_authors(project = NULL, browser = getOption("browser"),
encodeIfNeeded = FALSE)
}
\arguments{
\item{project}{Project \code{id} or unambiguous substring of the project name
from the \code{\link{projects}()} table. Defaults to \code{NULL} (see
\strong{Details}).}
\item{browser, encodeIfNeeded}{See \code{utils::\link[utils]{browseURL}()}.}
}
\description{
Invokes \code{utils::\link[utils]{browseURL}("mailto://[author emails]")} for
a specified project, or for the currently open project if \code{project} is
left as \code{NULL}.
}
\details{
The success of this function depends on the platform and the specified
\code{browser}. See the \strong{Details} and \strong{URL schemes} sections of
\code{utils::\link[utils]{browseURL}()}.
If \code{project = NULL}, the function selects the project in the
\code{\link{projects}()} table whose \code{path} is equal to
\code{rstudioapi::\link[rstudioapi]{getActiveProject}()}.
}
\examples{
# Wrapped in if (interactive()) because this function is interactive by nature.
if (interactive()) {
# If you have a projects() project open, just run it:
email_authors()
# Otherwise, specify a project:
###########################################################################
# Setup
old_home <- Sys.getenv("HOME")
old_ppath <- Sys.getenv("PROJECTS_FOLDER_PATH")
temp_dir <- tempfile("dir")
dir.create(temp_dir)
Sys.unsetenv("PROJECTS_FOLDER_PATH")
Sys.setenv(HOME = temp_dir)
setup_projects(path = temp_dir)
new_author("Rhonda", "Rondale", email = "ronda.rondale@co.uk")
new_author("Betty", "Betts", email = "betty@co.uk")
new_project("Inventing the Ring of Power", authors = c("Betty", "Ron"))
###########################################################################
email_authors("Ring of Power")
###########################################################################
# Cleanup (or just restart R)
Sys.setenv(HOME = old_home, PROJECTS_FOLDER_PATH = old_ppath)
}
}
\seealso{
\code{utils::\link[utils]{browseURL}()};
\code{rstudioapi::\link[rstudioapi]{getActiveProject}()} for information on
\code{browser} and \code{encodeIfNeeded} arguments.
}