reluem/contao-nc-file-gateway 问题修复 & 功能扩展

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

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

reluem/contao-nc-file-gateway

Composer 安装命令:

composer require reluem/contao-nc-file-gateway

包简介

Restores the Notification Center 1.x file/CSV gateway for Notification Center 2

README 文档

README

Contao bundle that restores the file/CSV gateway removed in Notification Center 2.

In NC 1.x you could append form submissions to a CSV file and optionally attach that file to notification emails. NC 2 dropped this gateway type. This bundle brings it back using the official NC 2 architecture (gateways, parcels, bulky-item vouchers).

Typical use case: store every form submission in a CSV under files/ and send the same CSV as an email attachment to an internal recipient.

Requirements

  • PHP 8.1+
  • Contao 4.13.50+ or Contao 5.3+
  • terminal42/notification_center ^2.6

Installation

composer require reluem/contao-nc-file-gateway

Then run migrations and clear the cache:

php vendor/bin/contao-console contao:migrate --no-interaction
php vendor/bin/contao-console cache:clear

Backend setup

1. Create a file gateway

Notification Center → Gateways → New gateway

Field Example
Type File/CSV
Export folder pick exports/form-submissions in the file manager

2. Add a file message to your notification

Notification Center → Notifications → your notification → Messages → New message

Field Example
Gateway your file gateway
File name submissions.csv
Storage mode Append
File content {{date::d.m.Y H:i}};##form_lastname##;##form_firstname##;##form_email##

The file content field defines one CSV line per submission. Use semicolons, simple tokens (##form_*##), and insert tags ({{date::…}}) as needed.

Important: sort this message before any mailer message in the same notification.

Email integration

To attach the CSV to an outgoing email in the same notification:

  1. Create (or edit) a mailer message in the same notification.

  2. Set the mailer message sorting lower than the file message (file message runs first).

  3. In the mailer message language settings, add this token to Attachment tokens:

    ##nc_file_voucher##
    
  4. Configure recipients, subject, and body as usual.

Example notification layout:

Sorting Message Gateway Purpose
1 Save CSV File/CSV Writes/appends the CSV line
2 Internal notification Contao Mailer Sends email with CSV attached

When the form is submitted, NC processes messages in order:

  1. The file message writes the new line to the configured CSV.
  2. The mailer message picks up the voucher from step 1 and attaches the current CSV file to the email.

You can combine ##nc_file_voucher## with other attachment tokens if needed.

How it works

  1. NC creates parcels for all messages in sorting order.
  2. For file messages, FileExportListener appends the CSV line and stores a bulky-item voucher.
  3. For mailer messages with ##nc_file_voucher##, MailerFileAttachmentListener adds that voucher as an attachment.

Migration from NC 1.x

If NC 2 already dropped the old file_* columns, this bundle's migration re-adds:

  • tl_nc_gateway.file_type, tl_nc_gateway.file_path
  • tl_nc_language.file_name, tl_nc_language.file_storage_mode, tl_nc_language.file_content

Existing language records keep their values if the columns were preserved in your database.

License

LGPL-3.0-or-later

reluem/contao-nc-file-gateway 适用场景与选型建议

reluem/contao-nc-file-gateway 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 07 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 reluem/contao-nc-file-gateway 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2026-07-15