eagleminds/whatsapp-sender 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eagleminds/whatsapp-sender

Composer 安装命令:

composer require eagleminds/whatsapp-sender

包简介

A basic package for sending WhatsApp messages through API

README 文档

README

WhatsApp Message Sender API Library for PHP

WhatsApp message send with WhatsApp-Sender This library provides a simple and efficient way to send WhatsApp messages programmatically using PHP. It is designed to work seamlessly with Laravel and can be easily integrated into your projects using Composer.

Features

  • Send Messages: Send text, images, videos, documents, and other media via WhatsApp.
  • Laravel Integration: Built with Laravel developers in mind for smooth integration.
  • Composer Support: Easily install and manage dependencies using Composer.

Installation

You can install this library via Composer. Run the following command in your terminal:

composer require eagleminds/whatsapp-sender

Usage

Initialize the Library

First, you need to initialize the WhatsApp message sender with your credentials:

use Eagleminds\WhatsappSender\WhatsAppSender;

Send a Message

You can then use the sendMessage method to send a message to a WhatsApp recipient:

 public function sendMessage(Request $request)
    {
        // Get mobile number and message from request
        $mobileNumber = $request->input('mobile_number');
        $message = $request->input('message');

        // Send WhatsApp message
        try {
            $response = $this->whatsappSender->sendWhatsAppMessage($mobileNumber, $message);
            return response()->json(['success' => true, 'message' => 'WhatsApp message sent successfully', 'response' => $response]);
        } catch (\Exception $e) {
            return response()->json(['success' => false, 'message' => 'Failed to send WhatsApp message', 'error' => $e->getMessage()], 500);
        }
    }

Send Media

To send media such as images, videos, or documents, use the sendMediaMessage method:

$mediaUrl = 'https://example.com/image.jpg';
$caption = 'Check out this image!';
$response = $sender->sendMediaMessage($recipient, $mediaUrl, $caption);

WhatsApp Sender Platform Documentation

This repository contains documentation for integrating with the WhatsApp Sender Platform provided by Track New. This platform allows you to send WhatsApp messages programmatically using APIs. Below are the steps to register, login, and obtain the necessary keys and template IDs for integration.

Registering and Logging In

To use the WhatsApp Sender Platform, you need to register on the WhatsApp-Sender website.

Registration Steps

  • Visit the WhatsApp-Sender website.
  • Click on the "Sign Up" or "Register" button.
  • Fill out the registration form with your details, including email address and password.
  • Submit the form to create your account.

Logging In

  • Go to the WhatsApp-Senderr website.
  • Click on the "Login" button.
  • Enter your registered email address and password.
  • Click on "Login" to access your account dashboard.

Obtaining API Key and Template ID

After logging in, you will need to obtain the necessary API key (app_key), authentication key (auth_key), and template ID for integrating with the WhatsApp Sender Platform.

Getting API Key (app_key) and Authentication Key (auth_key)

  • Once logged in, navigate to your account settings or dashboard.
  • Look for an option like "My Apps" then click app "Integration Settings".

app_key

  • Get authentication key (auth_key) click Auth key menu and show Auth key. auth_key
  • Note down these keys as they will be required for API authentication.

Obtaining Template ID

  • In your account dashboard, find the section related to message templates or templates management. template_create
  • Create a new template if required or select an existing template. template_id
  • Note down the template ID associated with the template you wish to use for sending messages.

Examples

Here are some examples to help you get started:

Sending a Text Message

$response = $sender->sendMessage('whatsapp_number', 'Hello, World!');

Sending an Image

$mediaUrl = 'https://example.com/image.jpg';
$caption = 'Check out this image!';
$response = $sender->sendMediaMessage('whatsapp_number', $mediaUrl, $caption);

Requirements

  • PHP 7.0 or higher
  • Laravel 5.5 or higher (if using with Laravel)

License

The MIT License (MIT). Please see License File for more information.

eagleminds/whatsapp-sender 适用场景与选型建议

eagleminds/whatsapp-sender 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 05 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「framework」 「php」 「rest」 「api」 「library」 「composer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 eagleminds/whatsapp-sender 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 eagleminds/whatsapp-sender 我们能提供哪些服务?
定制开发 / 二次开发

基于 eagleminds/whatsapp-sender 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 13
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-16