vCardMap

Component ID

2082677

Component name

vCardMap

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This module generates version 4.0 vCards from Drupal 7 user profile information.

It provides an admin page where mappings from Drupal's own user data
to vCard entries can be defined to control what data is output to the vcard.
A vcard for any registered user can then be obtained programmatically using the
vcardmap_getvcard() function.

Obvious uses are to export user data in vCard format to be used for all the
things a vCard is intended for.

Once installed, access /admin/settings/vcardmap to configure the way that
your user's data is mapped to the vCard fields.

Typically, to make this module useful, you will first need to add some suitable
profile fields - address, phone nunmbers etc. - for your users to fill in. This
module doesnt do that. You can call them anything you like and this module's
admin page will find them and map them.

Once you have the necessary profile fields and a mapping set up for them,
a vCard for any registered user can then be obtained using the
vcardmap_getvcard($account) function, which takes a user account as a
parameter and returns a vCard for that user.

In your code,

  global $user;
  $vcardstring = vcardmap_getvcard($user);

Will get you a string like this:

BEGIN:VCARD
  VERSION:4.0
  BDAY:19320910
  ORG;work:Unified Technology Ltd
  TEL;work,voice:0161 881 5225
  FN;home:Phil Robinson
  ADR;work:My Work Address
Some town
United Kingdom
M19 3NP
  ADR;home:My Home Address
Some other town
United Kingdom
M19 3NP
  TITLE;work:Dogsbody
  PHOTO;VALUE=uri;MEDIATYPE=image/jpeg;ENCODING=8BIT:http://your.domain.com/sites/default/files/pictures/picture-1.jpg
  EMAIL;work:philrobinson@unified-technology.co.uk
  REV:20130905T145915
  END:VCARD