trac插件允许通过电子邮件通知wiki页面上的更改
TracWikiNotification的Python项目详细描述
trac wikinotification是一个允许用户(甚至是匿名用户, 只要设置了email)来选择他们想要的wiki页面 当它发生变化时(通过电子邮件)得到通知。
注意:更新wiki页面的用户将不会收到有关其自己页面的通知 变化。
启用插件
很简单:
[components] wikinotification.* = enabled
smtp_enabled必须在notification配置节中启用。
可用配置选项
下面是您的trac.ini上可以包含的选项 wiki-notification。您也可以通过web管理界面配置它们。
Config Setting | Default Value | Explanation |
redirect_time | 5 (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_bcc | empty | Comma separated list of email address(es) to always send notifications to, addresses do not appear publicly (Bcc:). |
smtp_always_cc | empty | Comma separated list of email address(es) to always send notifications to, addresses can be seen by all recipients (Cc:). |
from_email | trac.wiki@localhost | Sender address to use in notification emails. |
from_name | None | Sender name to use in notification emails. Defaults to project name. |
use_public_cc | False | Recipients can see email addresses of other CC’ed recipients. If this option is disabled(the default), recipients are put on BCC. |
attach_diff | False | Send changes diff as an attachment instead of on the email text body. |
subject_template | $prefix $pagename $action | A Genshi text template snippet used to get the notification subject. |
banned_addresses | empty | Comma 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文档,看看是否有 打破模板中的任何逻辑。