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.
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/
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.
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.
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
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/
My issue is resolved now. Thank you!