agenciafmd/laravel-salesforce

dev-master 2023-06-19 18:41 UTC

This package is auto-updated.

Last update: 2024-09-19 22:22:13 UTC


README

Licença

  • 将转换发送到 Salesforce

安装

composer require agenciafmd/laravel-salesforce:dev-master

配置

为了进行集成,我们需要 API URL

因此,需要在 .env 文件中填写地址

SALESFORCE_API_URL=https://agenciafmd.secure.force.com/services/apexrest/LeadConnector

如果需要认证,需要在 .env 文件中提供数据

SALESFORCE_API_AUTH=https://seu-endereco-para-gerar-token.sandbox.my.salesforce.com/services/oauth2/token
SALESFORCE_USERNAME=username@email.com
SALESFORCE_PASSWORD=sua_senha
SALESFORCE_CLIENT_ID=seu_client_id
SALESFORCE_CLIENT_SECRET=seu_client_secret
## Uso

Envie os campos no formato de array para o SendConversionsToSalesforce.

O campo **email** é obrigatório =)

Para que o processo funcione pelos **jobs**, é preciso passar os valores dos cookies conforme mostrado abaixo.

```php
use Agenciafmd\Salesforce\Jobs\SendConversionsToSalesforce;

$data['email'] = 'milena.ramiro@fmd.ag';

SendConversionsToSalesforce::dispatch($data + [
        'LastName' => 'Milena Ramiro',
        'MobilePhone' => '17982036569',
        'idEmpreendimentoInteresse' => 'b5t5f00016FAqSRavP',
        'utm_campaign' => Cookie::get('utm_campaign', ''),
        'utm_content' => Cookie::get('utm_content', ''),
        'utm_medium' => Cookie::get('utm_medium', ''),
        'utm_source' => Cookie::get('utm_source', ''),
        'utm_term' => Cookie::get('utm_term', ''),
    ])
    ->delay(5)
    ->onQueue('low');

请注意,在我们的示例中,我们将作业发送到 low 队列。

请确保您正在运行 queue:work,如下所示。

php artisan queue:work --tries=3 --delay=5 --timeout=60 --queue=high,default,low