Boosting Sales Performance: Integrating Vicidial, Salesforce, and Laravel to Optimize Your Customer Relationship Management Strategy

Imagine you have a list of customers you must call from Vicidial's campaign. How can you pass the lead from Salesforce into Vicidial?

In this tutorial, I will teach you how to sync your customers from Salesforce into Vicidial using Laravel.

Requirements:

  • Salesforce account.

  • Vicidial account, Vicidial list, and Vicidial API user.

  • Laravel

We will assume you already have the integration between Salesforce and Laravel. If you want to learn how to do you can follow this tutorial:
FROM SALESFORCE TO LARAVEL: A GUIDE TO SUCCESSFUL LEAD MANAGEMENT INTEGRATION

How to connect Vicidial with Laravel

We will need to install a package to use Vicidial API.

                                        
                                            composer require masterfermin02/vicidial-api-wrapper
                                        
                                    

Add the Vicidial API user and password to the .env file.

                                        
                                            VICIDIAL_API_USER={USER}
VICIDIAL_API_PASS={USER}
VICIDIAL_URL=
                                        
                                    

Create a new service provider class on App\Providers with the name VicidialServiceProvider.

                                        
                                            <?php

namespace App\Providers;

use Vicidial\Api\Wrapper\Admin\Client as VicidialAdmin;

class VicidialServiceProvider
{
    public function register()
    {
        $this->app->singleton(VicidialAdmin::class, function ($app) {
            return new VicidialAdmin(
                env('VICIDIAL_URL'),
                env('VICIDIAL_API_USER'),
                env('VICIDIAL_API_PASS')
            );
        });
    }
}
                                        
                                    

Add the new service provider to the config app on the providers list:

                                        
                                            \App\Providers\VicidialServiceProvider::class,
                                        
                                    

Now we only need to query the leads from Salesforce and then send them to Vicidial:

                                        
                                            <?php

namespace App\Http\Controllers\Vicidial;

use Illuminate\Http\Response;

class SaleForceController extends Controller {
  
  public function sendToVicidial(VicidialAdmin $admin): Response
  {
	$leads = Forrest::query('SELECT 
	Id,
	FirstName,
	LastName,
	Email,
	PhoneNumber
	FROM Lead')->records;

	foreach ($leads as $lead) {
	  $admin->add_lead([
	  	'first_name' => $lead->FirstName,
		'last_name' => $lead->LastName,
		'email' => $lead->Email,
		'phone_number' => $lead->PhoneNumber,
	  ]);
	}
  }
	
}
                                        
                                    

Conclusion

In this blog post, we've explored how to successfully integrate Vicidial and Salesforce using Laravel. Following this tutorial, you can leverage Salesforce's powerful lead management capabilities in your Laravel application and the communication feature Vicidial.