承接 fivesqrd/fluent-client-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

fivesqrd/fluent-client-php

Composer 安装命令:

composer require fivesqrd/fluent-client-php

包简介

The Fluent Messaging client library

README 文档

README

Programmatic approach to generating and sending responsive user notifications via e-mail

Benefits

  • Easy API to generate HTML based e-mail bodies in your app
  • Less time wrestling with CSS inlining
  • Automatically responsive

Install

php composer.phar require fivesqrd/fluent:4.0

For Laravel projects there is an easy to install package available

composer require fivesqrd/fluent-laravel

Register

To send messages you'll first need to register Fluent account. Once registered, you'll receive API key to start sending messages immediately.

Quick Examples

Create and send a message:

$messageId = Fluent\Factory::message()->create()
    ->title('My little pony')
    ->paragraph('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent ornare pellentesque neque non rutrum. Sed a sagittis lacus.')
    ->number(['caption' => 'Today', value => date('j M Y')])
    ->button('http://www.mypony.com', 'Like my pony')
    ->paragraph('Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.')
    ->when(date('D') == 'Sun', function ($message) {
        $message->paragraph('Something that will only display on Sundays');
    })
    ->teaser('This is a teaser')
    ->subject('Testing it')
    ->header('Reply-To', 'me@myapp.com')
    ->to('user@theirdomain.com')
    ->send();

The following methods are provided to set up the delivery of the message:

header($key, $value) or headers($values)

/* Add a header to the message */
$message->header('Reply-To', 'me@myapp.com');
/* Add multiple headers to the message */
$message->headers(array(
    'Reply-To', 'me@myapp.com',
    'X-Fluent', 'lorem'
));

from($address, $name = null)

/* Set the sender address and name */
$message->from('me@myapp.com', 'My App');

attach($filename, $mimetype, $blob) or attachments($values)

/* Add an attachment to the message */
$message->attach('My-Attachment.pdf', 'application/pdf', file_get_contents($file))
/* Only add an attachment if the condition is satisfied */
$message->attachWhen(file_exists($file), 'My-Attachment.pdf', 'application/pdf', file_get_contents($file))
/* Add multiple attachments to the message */
$message->attachments(array(
    ['name' => 'My-First-File.pdf', 'type' => 'application/pdf', 'content' => file_get_contents($file)],
    ['name' => 'My-2nd-File.jpg', 'type' => 'image/jpg', 'content' => file_get_contents($file2)],
));

send()

Send is the final method of the chain and should always be called last. It delivers to message to the Fluent Web Service and returns a unique message ID.

/* Send the message */
$messageId = $message->send();

Plain Text

$messageId = Fluent\Factory::message()
    ->create('This is a plan text email body')
    ->subject('Testing it')
    ->header('Reply-To', 'me@myapp.com')
    ->to('user@theirdomain.com')
    ->send();

Find problematic events related to a user's email adress:

$response = Fluent\Factory::event()->find()
    ->to('user@theirdomain.com')
    ->since(date('Y-m-d H:i:s', $timeframe))
    ->type(['hard_bounce', 'soft_bounce', 'reject'])
    ->fetch();

fivesqrd/fluent-client-php 适用场景与选型建议

fivesqrd/fluent-client-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.03k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 06 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 fivesqrd/fluent-client-php 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 3.03k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 31
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-06-13