FlexContact Stack

Create a mailto link automatically from a CSV file or from contacts found on any web page.
Overview
FlexTable Stack icon
If you need to maintain a mailing list and provide a mailto link on your page, this is the Stack to do it easily and automatically. This Stack can create a mailto link from email addresses gathered from any existing web page, or from any text or CSV file you prepare. The code automatically removes duplicates, and can automatically delimit email addresses with comma or semicolon depending on the user agent - so you always get a properly formatted mailing list! Add optional subject and/or body to the link as well.

How does it work?
PHP is used to either read a CSV file or read the page at any URL and scan for email addresses.
  • FlexTable Stack screen shot
Customize
FlexTable Stack parameters
The FlexContact Stack has options for reading some or all lines of a CSV, or any web page to produce its mailto link. You can edit the text leading up to the link and after in, and edit properties of the link itself including optional subject and body text …

Parameters

 
File typeSelect the type of file to read: txt is a plain text file, one or many lines each with one or many e-mails, separated by space, tab, comma, or semicolon; html references any other web page in your site or another site; csv is a Windows csv table.
File to readProvide a relative file path or a complete url (containing http: or https:) to a the file type specified above, from which to read non-blank, non-comment (starts with #) lines. For csv type, additional controls below allow filtering which lines are read. All files are automatically located one, two, or three directories above if not found exactly where specified first. If a url is specified it must be complete and the file must exist. Note that duplicate email addresses are automatically prevented.
Match file linesChoose which lines of the csv file will be read. By default All lines are used without regard to their content. You may choose to filter only those lines whose first, second, or last column word/number matches certain criteria.
... Match valueUse this field to specify a word or value that is used to filter the csv file, based on the setting above in Match file lines.
DelimiterThe mailto link that is produced as output will have e-mail addresses separated by this delimiter. Comma may work best for Mac and iPhone Mail, while Semicolon may work best for Outlook. Use Auto to let the code determine , when viewed on Mac and ; when viewed by Windows or other.
Link textText to place inside mailto link. Use the keyword auto" (default) to have the link text be the list of e-mail addresses."
Bold link textBold the link text.
Add addressesStart with the specified list of addresses and add to them from the file. Default is to start with a blank list and build upon it from the file contents only. This could be useful for always including the webmaster in a mailing list. Duplicates are automatically prevented.
SubjectOptional subject for the e-mail. Leave this blank for no subject.
BodyOptional body for the e-mail. Leave this blank for no body.
Examples
Check out an example of FlexContact
Example 1: a mailto link based on the contents of a CSV file in the project Resources folder …
To create and use a CSV file - Click to view more ...
Export from Excel or Numbers, or create it by hand in a text editor. Each line of your CSV file should look like this:
“X”,”Y”,”Z”,…
(strings surrounded by plain double-quotes, and separated by commas)
Note that any line beginning with # is considered a comment, and ignored. Blank lines are also ignored.

Place the CSV spreadsheet where you can use it:
Drag the CSV file into your RapidWeaver Resources or Publish the flle online somewhere (you will need the URL in this case).

Add a FlexContact and use the CSV file:
In RapidWeaver, add a FlexContact Stack to your page and set the File type option to csv.
Then specify the path to your file as resources/yourfile.csv (FlexContact is smart enough to look around for your resources directory so don’t worry about ../resources, or ../../resources etc.)
If your CSV file is online somewhere else you can specify the file name as a URL instead, such as http://somewhere.com/yourfile.csv

Choose how to read the CSV file:
FlexContact will read all lines by default and use as many email addresses as it can find.
You can filter the lines that are read by telling FlexContact to match the contents of the first, second, or last column.

Here is the CSV file for this example below …
"bob@something.com"
"this line has other text","jim@something.com"
"dave@something.com,bill@something.com","nobody@something.com"
FlexContact link: Mailing List from CSV File (please don’t actually mail to this list!)

FlexContact Features

  • Requires PHP
  • Sparkle updates

Purchase FlexContact

  • $4 USD via PayPal
  • Immediate download *