Skip Navigation

[Resolved] Dynamically create vcard download from custom fields

This thread is resolved. Here is a description of the problem and solution.

Problem:

Is possible to create downloadable vcard file with Toolset plugins?

Solution:

There isn't such kind of built-in feature within Toolset plugins, it needs custom codes, for example:

https://stackoverflow.com/questions/51813817/export-vcard-from-js-and-open-in-contacts

Relevant Documentation:

This support ticket is created 3 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by Edward Barker 3 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1998303

Hi,

I'm trying to create a link on a custom post template that creates and triggers a download of a vcard to create a contact compromising of first name, last name, phone and email.

I can't find anything anywhere to even point me in the right direction. Any help would be much appreciated.

#1998547

Hello,

Please elaborate the questions with more details:
What kind of "download of a vcard" do you want?

I assume you are going to create two different post with one post for, if it is, it needs custom codes, for example:

Toolset Forms plugin support creating post front-end, after user submit the form, you can use action hook "cred_save_data" to trigger a custom PHP function
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

in this PHP function, you can get the custom field values:
https://developer.wordpress.org/reference/functions/get_post_meta/
and use them to create another post manually:
https://developer.wordpress.org/reference/functions/wp_insert_post/

#1998757

The concept I have in mind is that a user signs up to the site and registers their contact details. Each users details will be published as part of a custom post type (because it's been well documented that we can't do a content template for users directly).

As part of that content template there's a button that if someone is using a mobile device triggers it, then a new contact is automatically generated on their device based on their most up to date details.

#1998863

Toolset plugins can not create the vcard file(.vcf), but you can add a custom file field:
https://toolset.com/course-lesson/creating-custom-fields/
let your user upload it manually.

#1998901

Would it be possible to modify this nearly complete script and add in custom fields instead?

https://stackoverflow.com/questions/51813817/export-vcard-from-js-and-open-in-contacts

#2000119

Yes, it is possible with custom codes, but according to our support policy, we don't provide custom codes support:
https://toolset.com/toolset-support-policy/

When you need custom coding which extends Toolset functionality, we recommend contacting one of Toolset certified consultants:
https://toolset.com/contractors/

#2003151

My issue is resolved now. Thank you!