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第三方库


热门话题
GridLayout不工作的java问题   java Restlet请求对象不包含身份验证信息   java使用Cucumber为每个正在运行的线程创建一个TestNG runner类   java在平面文件中存储并跟踪它们?   类Lcom/google/firebase/FirebaseApp中没有虚拟方法zzbzo()Z;或者它的超类   java如何在安卓中创建字符串模式   可从Java访问的树莓PI传感器   java 50+GB分隔文件中的大致行数   是否有Java进程内数据库,允许从多表虚拟机访问?   当我使用ArrayList时,HashMap中的Java ArrayList会导致HashMap中的数据被删除。去除   如何将值存储在最佳java集合结构中   java消息Servlet。servlet appServlet的init()引发异常   java正在使用Spring引导生成空日志文件   c#在访问实例变量时使用this关键字是否更有效?   java JScrollPane滚动到最后添加的行   java Vertx抛出IllegalStateException:响应已被写入   java Liferay以编程方式更改portlet列   java下载单个s3对象并将它们合并到单个文件中   java spark数据帧将JSON转换为ORC满足“列模糊异常”