Description Usage Arguments Template textfile Data file Author(s) Examples
A plain textfile (.txt
) is used as a template to
create emails. The textfile may contain any number of
arbitrary tags of the form <<tag>>
. The template
is parsed and the tags are replaced by values taken from
a data file. The data is contained in an Excel
(.xlsx
) or comma seperated value .csv
file.
Based on these two files an email for each line of the
data in the data file is created using the default email
program.
1 2 | serialmail(tfile, dfile, output = "email",
subject = "subject line", intag = "<<", outtag = ">>")
|
tfile |
Path to template file. Must be a |
dfile |
Path to data file. Must be a |
output |
String. Type of output. Default is to
generate an |
subject |
Subject line of email, default is
|
intag |
String. The opening signs for tags. The
default is |
outtag |
String. The closing sign for tags. The
default is |
The template file contains plain text and tags using double braces as indication for a tag<<tag>>. Any tag name can be used as long as it appears in the header of the data file. An example:
Hello <<name>>, your exam mark is <<mark>>. Best,
Mark.
The data file can be an Excel file. Then the tags without sourrounding braces are the headers, i.e. contained in the first row of the Excel spreadsheet. Only the first spreadsheet is read.
For comma seperated value files the case is the same. The
tags without braces are used as headers. Semicolons are
used as seperators An example (.csv
):
name; surname; mark
Mark; Heckmann; 1,3
Holger; Doering; 1,3
Mark Heckmann
1 2 3 4 5 6 | ## Not run:
# download the files template.txt and data.csv from github dowload page
serialmail("template.txt", "data.csv")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.