Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-10 14:45:42

Matl
Member
From: Brannenburg, Germany
Registered: 2007-06-18
Posts: 13
Website

How to generate vcard or vcf and send it by Email

Is there a possibility to make a formular, which has the possibility to generate a vcard and send it per Email. I want to make a site for a youth-organisation. They have courses, to which anyone can log-on per Email. In the Email should be a vcard. So they can take the name, adress … in a filemaker database.

Offline

#2 2008-04-10 17:04:27

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: How to generate vcard or vcf and send it by Email

Not quite clear: is the e-mail destined for the site’s users, or are you’re trying to get the site to generate a vCard out of the details that users provide and send it yourself?

In the first case you could use the hCard microformat which is essentially just HTML mark up to define your details. Brian Suda (see microformats page) has a script that can “compile” a vCard from these details which you can download. You basically link to it and it parses your page and proffers a vCard to download. Alternatively there are various browser plug-ins that can detect and read microformats (apparently firefox 3 will have this built in).

Anyhow, you can create microformats manually using a form that you mark up accordingly or use pnh_mf which is a txp plugin that adds a simple way to incorporate microformats into your website.

In the second case, I don’t know off hand if there is a create-and-mail script for such things. You could use the same method described above to present the user’s log-on details and then download them from the browser instead of an e-mail. I can imagine there are easier ways to recover data from your site in a format that can be read into filemaker, e.g. direct transfer from the database (phpmyadmin exports in sql, csv and excel and you could set up a cron-job to execute a suitable db-query and dump to do that for you and mail you the details).

Alternatively make a hidden (i.e. not otherwise linked) section with a custom page template that outputs a table or csv file based on the user’s details. Then cut and paste from the browser. You could combine this last method with chs_if_urlvar to list only those registered since a certain date by entering mydomain.tld/userlist/&since=”{date}” or something along those lines.

Hope some of those ideas help you further…


TXP Builders – finely-crafted code, design and txp

Offline

#3 2008-04-10 20:37:40

Matl
Member
From: Brannenburg, Germany
Registered: 2007-06-18
Posts: 13
Website

Re: How to generate vcard or vcf and send it by Email

Many thanky. I mean, that the last suggestion with the hidden section will be the best. But I don’t know, how I get the datas from my php database.

(Ich weiß, dass mein Englisch ziemlich schlecht ist. Ich versuche es trotzdem, damit sich möglichst viele an dieser Diskussion beteiligen können. Deutsch fällt mir trotzdem leichter: Vielen Dank Jakob für die schnelle Antwort. Dein letzter Vorschlag scheint mir der beste zu sein, weil ich noch die Möglichkeit habe, Daten zu akzeptieren oder abzulehnen. Allerdings habe ich nur eine sehr leise Ahnung davon, wie ich das umsetze. Wenn ich es richtig verstehe, muss ich mit microformat Felder bestimmen und ausfüllen lassen, die dann in meine php-Datenbank geschrieben werden. Wie ich diese Daten auf eine versteckte Seite bekomme, ahne ich auch schon. Wie ich diese Daten dann allerdings so exportieren kann, am besten durch einen button, dass ich sie in eine Datenbank importieren kann, ist mir noch nicht klar. Für weitere Hilfe wäre ich sehr dankbar.)

Offline

#4 2008-04-10 22:35:34

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: How to generate vcard or vcf and send it by Email

Matl, Deutsch ist ja kein Problem, nur besser in der andere Forum. Ich mache weiter auf Englisch, aber falls es noch unklar ist, schicke mir einfach eine Mail.

I don’t know Filemaker but I imagine that it can accept imported data in a whole variety of formats, not just as vCards. In a previous project (not txp but similar) I’ve output membership details stored in an online database where the members can edit their own details online into a table that has the same number of columns as the one the secretary uses for their word mailmerge. The secretary calls up the page, copies it in full into the clipboard, pastes it into excel and saves it. It can then be used directly in the word mailmerge. The page is password protected so that not everyone can look up the members’ private details.
In this case it was a straightfoward html table but it could just as easily have been a csv file.

I can imagine that sometimes one only needs the recent entries rather than replacing the whole list of details. Here you can use txp:article(_custom) in combination with date/month etc. to grab only some of the recent details saved in your txp articles. By using chs_if_urlvar, you can change the time parameter by entering it in the address bar.

None of that requires microformats or hCards at all. microformats don’t really have fields. You just attach predefined classes (described in the link above) to particular elements on the page to identify what they are, e.g. this bit is the name, this is the telephone number etc. It is invisible to the normal reader but a browser plug-in or a script such as Brian Suda’s will read the page, identify the relevant parts and extract them to make a vcard or to import it into your address book.

If you want to use either method, you need your students to enter their details through a form. You could use a plugin such as mem_moderation in conjunction with mem_form to allow them to enter the relevant details directly into txp-articles (the admin gets a chance to vet and correct the information if necessary). You can then output them in whatever form works best for you and filemaker, either as a table, a csv or as a series of vCards.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB