codeq/publishnotifier

该软件包在有人向内部工作空间发布时向管理员发送通知。

v3.0.0 2023-01-10 20:02 UTC

This package is auto-updated.

Last update: 2024-09-14 18:53:18 UTC


README

每次有人向内部工作空间发布时,该软件包都会发送通知。如果内部工作空间已有未发布更改,则不会再次发送通知,以避免垃圾邮件涌入Slack频道或电子邮件收件箱。

通过composer简单安装软件包

composer require codeq/publishnotifier

确保您的网站已定义Neos.Flow.http.baseUri设置,以便您的审阅者获得正确的URL。如果您不想这样做,您可以在消息文本中手动设置域名,如下所示

请审阅更改并发布到实时:https://example.com/%3$s'

电子邮件通知配置

为了发送电子邮件,您需要配置neos/swiftmailer凭证

然后您需要配置目标电子邮件地址以及电子邮件内容

CodeQ:
  PublishNotifier:
    email:
      enabled: false
      senderName: 'Neos'
      senderAddress: 'no-reply@neos-server.com'
      notifyEmails:
        - 'notifyme@example.com'
      subject: '%1$s has published changes'
      body: |+
        %1$s has published changes to the private workspace %2$s.
        Please review the changes and publish to live: %3$s'

Slack消息配置

为了向Slack发送消息,您需要在您的Slack工作空间中添加一个入站WebHook。更多关于此的信息,请参阅这里 https://api.slack.com/incoming-webhooks

由于入站webhooks被视为Slack应用,它们绑定到单个频道。因此,您可以为多个“postTo”配置多个webhooks

CodeQ:
  PublishNotifier:
    slack:
      enabled: false
      postTo:
        myExampleTarget:
          webhookUrl: 'https://hooks.slack.com/services/...'
      message: |+
        %1$s has published changes to the private workspace %2$s.
        Please review the changes and publish to live: %3$s'

可能的改进

  • 自动获取所有实时发布者的电子邮件地址。
  • 显示更改的视觉差异。