artyomnar/lead-form-provider

Takes simple lead form from any web page and provide it into telegram

v1.0 2021-05-20 09:17 UTC

This package is auto-updated.

Last update: 2024-10-24 15:06:42 UTC


README

Takes simple lead form from any web page and provide it into telegram. Lead form must not contain any files.

Latest Stable Version Total Downloads

Installation

The preferred way to install this extension is through composer.

Either run

composer require artyomnar/lead-form-provider

or add

"artyomnar/lead-form-provider": "*"

to the require section of your composer.json.

Usage

$leadForm = $_POST['leadForm'];
$env = App::getEnvirenment();
$botToken = 'xxxxxxxxxxxxxxxx';
$chatId = '@myChannel';

$success = LeadFromProvider\LeadFromHandler::send($leadForm, $env, $botToken, $chatId);

return $success ? 'Form accepted successfully' : 'Error, try later';