mundocrm/leads-sender

Vendor to send leads forms to mundocrm.ar.

v0.2 2022-02-15 23:38 UTC

This package is auto-updated.

Last update: 2024-04-16 23:32:35 UTC


README

Latest Version license: MIT

Description

This package provide the methos to compile a form data and send to api.mundocrm.ar.

What is included?

  • Sender interface:
    • With this can generete you lead sender.
    • Send function to insert on your source the lead.
    • Validate and return response success or error.

Installation and configuration

Install via Composer

We recommend installing this package with Composer.

  1. Download Composer

To download Composer, run in the root directory of your project:

curl -sS https://getcomposer.org/installer | php

You should now have the file composer.phar in your project directory.

  1. Install Dependencies

Run in your project root:

php composer.phar require mundocrm/leads-sender

You should now have the files composer.json and composer.lock as well as the directory vendor in your project directory. If you use a version control system, composer.json should be added to it.

Require Autoloader

After installing the dependencies, you need to require the Composer autoloader from your code:

require 'vendor/autoload.php';

How can you use it

  1. Create a new Sender:
 $leads = new Sender($app_key, $source_id, $data, $items, $debug); 
  1. Instance send function:
$response = $leads->send();
  1. Process the response as you preferer:
// Example to simple return
echo json_encode($response);

// Example to Laravel response:
return response()->json($response, $response->status_code);

License

MuundoCRM and vendors are made available under the MIT License (MIT). Please see License File information.