Zoho CRM Lead Magnet Shortcodes

Below, you’ll find a detailed guide on how to add the Zoho CRM Lead Magnet Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Zoho CRM Lead Magnet Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Zoho CRM Lead Magnet Plugin and the shortcodes it provides:

Plugin Icon
Zoho CRM Lead Magnet

"Zoho CRM Lead Magnet is a powerful WordPress plugin that streamlines your lead generation process. With this plugin, you can easily create and integrate Zoho CRM forms on your site."

★★★✩✩ (22) Active Installs: 4000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [zohocrm-web-form]
  • [zcf_forms_mig_listoffields]

Zoho CRM Lead Magnet [zohocrm-web-form] Shortcode

The Zoho CRM Forms shortcode is a powerful tool that generates contact form fields. It utilizes global variables and merges JSON-encoded form settings with new shortcode fields. This shortcode retrieves form properties and settings, checks for duplicates, and updates records if needed. It then maps these fields for posting, making data management efficient.

Shortcode: [zohocrm-web-form]

Parameters

Here is a list of all possible zohocrm-web-form shortcode parameters and attributes:

  • id – unique identifier of the contact form
  • name – specifies the name of the contact form, if left empty, it defaults to the form’s id
  • module – determines which module of the CRM the form is associated with
  • assigned_to – determines who in the CRM is assigned to the submitted form
  • duplicate_handling – controls how the plugin handles duplicate form submissions
  • update_record – if set, the plugin will update an existing record instead of creating a new one

Examples and Usage

Basic example – A simple usage of the shortcode to display a Zoho CRM web form by referencing its ID.

[zohocrm-web-form id="sample_form_id" /]

For advanced examples:

Advanced example 1 – Displaying a Zoho CRM web form using both ID and name. The function will first try to load the form by ID, but if not found, it will try to load by name.

[zohocrm-web-form id="sample_form_id" name="sample_form_name" /]

Advanced example 2 – Displaying a Zoho CRM web form with additional parameters. Here, the shortcode is used to display a form with an ID of “sample_form_id”, a name of “sample_form_name”, and the third party parameter is set to true.

[zohocrm-web-form id="sample_form_id" name="sample_form_name" thirdparty="true" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [zohocrm-web-form] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode("zohocrm-web-form", 'zcf_ContactFormFieldsGenerator');

Shortcode PHP function:

function zcf_ContactFormFieldsGenerator($attr, $thirdparty) {


    global $HelperObj;
    global $module_options, $module, $isWidget, $assignedto, $check_duplicate, $update_record, $formattr, $attrname;
    $module_options = 'Leads';
    $newform = new zcffieldlistDatamanage();
    if($attr['name'] ==''){
      $attr['name'] = $attr['id'];
    }
    $newshortcode = $newform->zcfformfieldsPropsettings($attr['name']);
    $FormSettings = $newform->zcfFormPropSettings($attr['name']);
    $formattr = array_merge(json_decode(json_encode($FormSettings), true), $newshortcode);
    $attrname = $attr['name'];
    $config_fields = $newshortcode['fields'];
    $module = $FormSettings->module;
    $assignedto = $FormSettings->assigned_to;
    $module_options = $module;
    $check_duplicate = $FormSettings->duplicate_handling;
    if (isset($shortcodes['update_record'])) {
        $update_record = $shortcodes['update_record'];
    }
    return zcf_ContactFormfieldlistsMapping($module, $config_fields, $module_options, "post", $thirdparty);
}

Code file location:

zoho-crm-forms/zoho-crm-forms/includes/crmcontactformgenerator.php

Zoho CRM Lead Magnet [zcf_forms_mig_listoffields] Shortcode

The Zoho CRM Forms shortcode, add_shortcode($key, “zcf_forms_mig_listoffields”), is a key function that assists in migrating form fields. It maps old form fields to new ones based on the ‘name’ attribute. .

Shortcode: [zcf_forms_mig_listoffields]

Parameters

Here is a list of all possible zcf_forms_mig_listoffields shortcode parameters and attributes:

  • $attr – An associative array that holds the attributes passed to the shortcode.
  • $htmlcontent – The enclosed content within the shortcode tags, if any.
  • $tag – The shortcode tag itself, in this case ‘zcf_forms_mig_listoffields’.
  • $key – The key used in the shortcode, which is the form name in this context.
  • $name – The name attribute of the form field, which can be set via the ‘name’ attribute in the shortcode.

Examples and Usage

Basic example – A simple shortcode that uses the ‘zcf_forms_mig_listoffields’ function to generate a contact form fields. No parameters are passed in this example, so the function will return a form with default fields.

[zcf_forms_mig_listoffields]

Advanced examples

Using the shortcode to generate a contact form by passing the ‘name’ parameter. This will generate a form with fields that match the ‘oldrandomname’ value in the $migrate array. If the ‘oldrandomname’ value is not found, it will use the ‘newrandomname’ value.

[zcf_forms_mig_listoffields name="oldname"]

In this advanced example, we are passing multiple ‘name’ parameters to the shortcode. This will generate a contact form with fields that match the ‘oldrandomname’ values in the $migrate array. If any ‘oldrandomname’ value is not found, it will use the corresponding ‘newrandomname’ value.

[zcf_forms_mig_listoffields name="oldname1" name="oldname2" name="oldname3"]

PHP Function Code

In case you have difficulties debugging what causing issues with [zcf_forms_mig_listoffields] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode($key, "zcf_forms_mig_listoffields");

Shortcode PHP function:

function zcf_forms_mig_listoffields($attr, $htmlcontent, $tag) {
    global $migrationmap;
    $migrate = $migrationmap[$tag];
    foreach ($migrate as $key => $value) {
        if (!isset($attr['name'])) {
            $name = $value['newrandomname'];
        } else {

            if ($value['oldrandomname'] == $attr['name']) {
                $name = $value['newrandomname'];
            }
        }
    }
    return zcf_ContactFormFieldsGenerator(array('name' => $name));
}

Code file location:

zoho-crm-forms/zoho-crm-forms/includes/crmcontactformgenerator.php

Conclusion

Now that you’ve learned how to embed the Zoho CRM Lead Magnet Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *