trac插件允许通过电子邮件通知wiki页面上的更改

TracWikiNotification的Python项目详细描述


trac wikinotification是一个允许用户(甚至是匿名用户, 只要设置了email)来选择他们想要的wiki页面 当它发生变化时(通过电子邮件)得到通知。

注意:更新wiki页面的用户将不会收到有关其自己页面的通知 变化。

启用插件

很简单:

[components]
wikinotification.* = enabled

smtp_enabled必须在notification配置节中启用。

可用配置选项

下面是您的trac.ini上可以包含的选项 wiki-notification。您也可以通过web管理界面配置它们。

Config SettingDefault ValueExplanation
redirect_time5 (in seconds)The default seconds a redirect should take when watching/un-watching a wiki page. This value is also definable per user, ie, user is able to configure this, of course for himself.
smtp_always_bccemptyComma separated list of email address(es) to always send notifications to, addresses do not appear publicly (Bcc:).
smtp_always_ccemptyComma separated list of email address(es) to always send notifications to, addresses can be seen by all recipients (Cc:).
from_emailtrac.wiki@localhostSender address to use in notification emails.
from_nameNoneSender name to use in notification emails. Defaults to project name.
use_public_ccFalseRecipients can see email addresses of other CC’ed recipients. If this option is disabled(the default), recipients are put on BCC.
attach_diffFalseSend changes diff as an attachment instead of on the email text body.
subject_template$prefix $pagename $actionA Genshi text template snippet used to get the notification subject.
banned_addressesemptyComma separated list of email addresses to never send notifications to.

如果要覆盖这些设置,则可以将其包括在 以下示例:

[wiki-notification]
redirect_time = 5
smtp_always_bcc = someone@somedomain, another.one@somedomain
smtp_always_cc = someone.else@somedomain
from_email = trac.wiki@localhost
from_name = Custom Name
use_public_cc = false
attach_diff = true
subject_template = Foo $prefix $pagename $action
banned_addresses = banned.user1@somedomain, banned.user2@somedomain

下载并安装

运行以下命令安装此插件:

> sudo pip install TracWikiNotification

其他注释(来自用户输入)

  • pip是从命令行(在Linux上)运行的,而不是从 Python。

  • 在为trac安装任何插件之后,您需要重新启动apache才能看到 它(不是所有对trac.ini的更改都需要重新启动,但添加插件需要重新启动)。

  • 确保将新插件添加到trac.ini

    [components]
    wikinotification.* = enabled
    
  • 还应该注意wiki的trac.ini配置 通知应该类似于:

    [wiki-notification]
    smtp_always_cc = someone@somedomain
    from_email = trac.wiki@localhost
    
  • 另一个注释:用户永远不会收到自己的wiki的通知 修改(测试插件时有点棘手:)

  • 请注意,旧版本的插件可能会设置subject_template config值,类似于 主题模板=$prefix$page.name$操作。这将导致“undefinederror:”page“未定义”。 使用$page name而不是$page.name

调整/自定义通知电子邮件模板

如果愿意,可以调整发送给用户的通知电子邮件模板。

wiki_notification_email_template.txt文件复制到trac环境中 templates/子目录并根据需要进行调整。

一定要阅读Genshi Text Templates文档,看看是否有 打破模板中的任何逻辑。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何让用户决定按钮的特定颜色   java Tomcat jdbc连接池,使用后不释放连接   Java泛型类可分配性   javaactivemq&如何在路由路径中创建依赖关系   java为什么没有接收到操作用户?   windows如何启动使用cmd中预编译DLL的java swing应用程序?   java JFreechart实时组合图,在未收到数据点的情况下呈现step子图表的上一个值   java排序自定义数组列表   java如何从HSLFSlideShow获取文本格式信息   java不能将片段和活动登录结合起来   java是下载位于远程存储服务中的文件的有效方法   java AS:将点数交给GameOverActivity   java如何在textView中将焦点放在新生成文本的顶部?   HashMap中特定于Java存储的类类型   java使用不同的变量类型进行计算   if语句中的Java poll()   检查匹配括号的java字符堆栈没有错误,但也没有任何作用   java Netbeans不断将应用程序部署到错误的服务器