承接 cyberwoven/webform_queued_post_handler 相关项目开发

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

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

cyberwoven/webform_queued_post_handler

最新稳定版本:1.0.2

Composer 安装命令:

composer require cyberwoven/webform_queued_post_handler

包简介

This module extends the Webform module's Remote Post Webform Handler plugin to make remote posts asynchronous using Drupal Queue API.

README 文档

README

This module extends the Webform module's Remote Post Webform Handler plugin to make remote posts asynchronous using Drupal Queue API. It only queues "Completed" urls. "Updated and "Deleted" urls are run like normal.

Setup

Just enabled the module and a new "Async Remote Post" handler should become available in the webform "Email / Handlers" section. After submitting a webform, the queued items should appear in the queue table, and should be processed on next cron run.

Notes

Testing / Debugging

For testing the Completed/Updated/Deleted urls, if you enable the "Webform Remote Post Example" module, the following urls will be available:

  • /webform_example_remote_post/completed
  • /webform_example_remote_post/updated
  • /webform_example_remote_post/deleted

You can use hidden fields as "confirmation tokens" to store a confirmation token from the remote post response data. The format of the token is [webform:handler:<handler_id>:<state>:<key>]

* `handler_id`: The handler id (eg: async_remote_post, async_remote_post_2...)
* `state`: completed/updated/deleted
* `key`: The key of whatever value you want in the response. I think it assumes a JSON response, but not sure.

For example [webform:handler:async_remote_post:completed:confirmation_number] will get replaced with a "confirmation_number" value from the "Completed URL" url response.

Retries

Currently, if a queued item fails for some reason, it will not be re-queued. So it basically only get's one shot. If we decide we want to give them more attempts, this can be done by throwing DelayedRequeueException, which tells the Queue API to requeue the item. However, the inherited remotePost function in AsyncRemotePostWebformHandler does not bubbled up exceptions, it handles them quietly and returns. So we need to override that function. This is done already, but commented out.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2023-03-23