cylancer/cy_mail_to_news 问题修复 & 功能扩展

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

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

cylancer/cy_mail_to_news

最新稳定版本:0.9.12

Composer 安装命令:

composer require cylancer/cy_mail_to_news

包简介

Creates news from mails

README 文档

README

Change log

  • 0.9.12 FIX : Category parser has a small bug.
  • 0.9.11 FIX : Compose requirment: "georgringer/news" : ">=12.3.0"
  • 0.9.10 FIX : Remove warning in the get data metod.
  • 0.9.9 FIX : Default media is displayed only in the list view.
  • 0.9.8 FIX : Fix the mail seen flag handling.
  • 0.9.7 FIX : Fix the attachment folder validation.
  • 0.9.6 FIX : Checkbox in the scheduler configuration works as expected.
  • 0.9.5 CHG : Change the extension icon.
  • 0.9.4 FIX : Manipulation rules for the news content rendering.
  • 0.9.3 FIX : htmlspecialchars encoding / decoding
  • 0.9.2 FIX : Fix the mail part analyse (mail in mail problem)
  • 0.9.1 UPD : Alpha version
  • 0.9.0 INI : Initial

Templates

You can descript the form of your news title or news body.

A very simple example

Title:

Automatic news

=> the title is always "Automatic news"

A simple example

Title:

{Subject}

=> Your title is replaced with the subject.

Combination of very simple and simple example

Title:

Automatic news: {Subject}

=> Your title is a combination of the static text: "Automatic news: " and the dynamic subject part.

A simple example with a special tag

Body:

{body}

=> Your body is replaced with the mail text body. You have three body options:

  • "bodyHtml" returns the HTML text of the email (if available)
  • "bodyPlain" returns the plain text of the email (if available)
  • "body" returns the HTML text of the email, if available; otherwise, the plain text.

A stronger example with replacement

You can manipulate the content of the replacement.

Title:

{Subject pattern="^\[spam] (.*)$" replacement="$1"}

=> Example set the title with the mail subject without the start word "[spam]".

HINT: The replacement rule will ignore if the pattern does not matched. In this example: When your mail subject has not a spam marker, the news title has the original subject.

Filter rules

The filter rules are defined in a JSON format. When the regex rule (set) matches, the task creates a news from the mail and mark this mails as "readed".

{
    "Subject": "[regex]",
    "body": "[regex]"
}

[regex] is a placeholder for a regular expression.

The keys are mail header keys or one of these special keys:

  • "bodyHtml" returns the HTML text of the email (if available)
  • "bodyPlain" returns the plain text of the email (if available)
  • "body" returns the HTML text of the email, if available; otherwise, the plain text.

Category rules

The category rules are defined in a JSON format. When a regex rule (set) matches, the news is added with the specified category.

{
   "[categoryUid]": {
       "Subject": "[regex]",
       "body": "[regex]"
   }
}

[categoryUid] is a placeholder for an integer and the category identifier. [regex] is a placeholder for a regular expression.

The keys are mail header keys or one of these special keys:

  • "bodyHtml" returns the HTML text of the email (if available)
  • "bodyPlain" returns the plain text of the email (if available)
  • "body" returns the HTML text of the email, if available; otherwise, the plain text.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2025-07-20