PHPackages                             emiliopuljiz/api-whatsapp-business - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. emiliopuljiz/api-whatsapp-business

ActiveLibrary[API Development](/categories/api)

emiliopuljiz/api-whatsapp-business
==================================

With this package you can create WhatsApp Business templates, start conversations through these templates. We are also going to have a panel to be able to receive and send messages with clients that we start conversations with.

1.1.2(2y ago)114[4 PRs](https://github.com/EmilioPuljiz/api-whatsapp-business/pulls)MITPHPPHP ^8.2|^8.2CI passing

Since Mar 26Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/EmilioPuljiz/api-whatsapp-business)[ Packagist](https://packagist.org/packages/emiliopuljiz/api-whatsapp-business)[ Docs](https://github.com/EmilioPuljiz/api-whatsapp-business)[ GitHub Sponsors](https://github.com/emiliopuljiz)[ RSS](/packages/emiliopuljiz-api-whatsapp-business/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (6)Versions (8)Used By (0)

api-whatsapp-business
=====================

[](#api-whatsapp-business)

[![Latest Version on Packagist](https://camo.githubusercontent.com/52de4c72d7866727d6a0bcc4c075d9c822c8d8ba932e70be7ff35988dc0d5695/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656d696c696f70756c6a697a2f6170692d77686174736170702d627573696e6573732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/emiliopuljiz/api-whatsapp-business)[![Total Downloads](https://camo.githubusercontent.com/dec94734241b195aeb866fc358dbac3280fef96c4141f8a95415353f22130d26/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656d696c696f70756c6a697a2f6170692d77686174736170702d627573696e6573732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/emiliopuljiz/api-whatsapp-business)

---

api-whatsapp-business is a package for Laravel that allows you to send WhatsApp templates dynamically to specified phone numbers. With this package, you can send templates regardless of the number of variables you have in the created template, making it easier to personalize the message for each recipient regardless of the complexity of the template.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require emiliopuljiz/api-whatsapp-business
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="emiliopuljiz-api-whatsapp-business-migrations"

php artisan migrate
```

🚀 **Initial Setup:**
--------------------

[](#-initial-setup)

1. **Register on Facebook Developers:**

    - Go to [Facebook Developers](https://developers.facebook.com/).
    - Obtain the following data:
        - App Identifier: XXXXXXXXXXXXXXX (Obtained once you enter the app in the upper left part of the menu).
        - Phone Number Identifier: XXXXXXXXXXXXXXX (Obtained in the left menu WhatsApp &gt; API Settings &gt; below the selected phone number for sending the test).
        - App Secret Key: XXXXXXXXXXXXXXXX (Obtained in the left side menu App Settings &gt; Basic).
2. **Database Configuration:**

    - Insert the `whatsapp_configurations` table into your database using the data obtained above.

📝 **Creating WhatsApp Templates:**

- Create a template in WhatsApp, for example:

    - **Name:** new\_user
    - **Type:** Utility (if it's for clients or users) / Marketing (if it's for other purposes)
- Example template body: Header: (Welcome to My Application)

    Body: Hello {{1}}, here is your access information:

    User: {{2}} Password: {{3}} Access My Application: {{4}}

    Footer: (Greetings from the My Application team)

This process will allow you to configure your package to send dynamic and personalized WhatsApp templates to your recipients.

Usage
-----

[](#usage)

- You should create a job. Then dispatch the work from the place where you will use it in your app
- Keep in mind that within the class you must make the call to use SendWhatsapp (The trait that we have in the package)

```
