Comment Notification
When a user posts a comment on the website or a user responds to a comment, Waline supports email or WeChat notification to the blogger and the author who responded to the comment. There are many types of blogger notifications, and only email notifications are supported for replying to comment authors.
Email Notification
Email notification needs the following environment variables to be configured:
SMTP_SERVICE
: SMTP Mail delivery service providerTips
You can find all support provider in here. If your provider is not listed, you must config
SMTP_HOST
andSMTP_PORT
.SMTP_HOST
: SMTP server address, it can be found in mailbox's setting page generally.SMTP_PORT
: SMTP server port, it can be found in mailbox's setting page generally.
SMTP_USER
: SMTP Mail delivery service account, it's your email address.SMTP_PASS
: SMTP Mail delivery service password, it's your email password.SITE_NAME
: Your site name, will be displayed in notification message.SITE_URL
: Your site url, will be displayed in notification message.
The following environment variables are optional:
SENDER_NAME
: Custom sender's name in notificationSENDER_EMAIL
: Custom sender's name in notificationMAIL_SUBJECT
: Custom comment reply email titleMAIL_TEMPLATE
: Custom reply email contentMAIL_SUBJECT_ADMIN
: Custom new comment notification email titleMAIL_TEMPLATE_ADMIN
: Custom new comment notification email contentAUTHOR_EMAIL
: The blogger’s email, used to judge whether posted comment is posted by the blogger. If it is posted by the blogger, there will be no reminder notification.
Wechat Notification
We use Mr. Server to wechat notification. You need to set SC_KEY
in env which applied in Mr. Server.
SC_KEY
: Token applied in Mr. Server, It's required for this service.AUTHOR_EMAIL
: The blogger’s email is used to distinguish whether the posted comment is posted by the blogger himself. If it is posted by the blogger, there will be no reminder notification.SITE_NAME
: Your site name, it will be displayed in notification message.SITE_URL
: Your site url, it will be displayed in notification message.
QQ Notification
We use Mr. Qmsg to send QQ notification. You need to set QMSG_KEY
in env which applied in Mr. Qmsg.
QMSG_KEY
: KEY applied in Mr. Qmsg, It's required for this service.QQ_ID
: The QQ ID of the receiver(s), except for QQ group. If there are more than one QQ ID, use commas to separate multiple values, e.g.1244453393,2952937634
(should all be included in your Mr. Qmsg's QQ ID list).AUTHOR_EMAIL
: The blogger’s email is used to distinguish whether the posted comment is posted by the blogger himself. If it is posted by the blogger, there will be no reminder notification.SITE_NAME
: Your site name, it will be displayed in notification message.SITE_URL
: Your site url, it will be displayed in notification message.QQ_TEMPLATE
: Notification template used by QQ. Variables and specific formats can be found in the notification template below. If not configured, the default template is used.
Telegram Notification
We use Telegram bot to send Telegram notification. You need to set the following env.
TG_BOT_TOKEN
: Telegram bot token to access the HTTP API. Create a bot with @BotFather to get this token. It's required for this service.TG_CHAT_ID
: Thechat_id
of the receiver. It can be an user, a channel or a group. @userinfobot will display thischat_id
when you forward a message to it. It's required for this service.AUTHOR_EMAIL
: The blogger’s email is used to distinguish whether the posted comment is posted by the blogger himself. If it is posted by the blogger, there will be no reminder notification.SITE_NAME
: Your site name, it will be displayed in notification message.SITE_URL
: Your site url, it will be displayed in notification message.TG_TEMPLATE
: Notification template used by Telegram. Variables and specific formats can be found in the notification template below. If not configured, the default template is used.
PushPlus Notification
pushplus is a message push platform which supports many channels like wechat, wechat work, ding talk, sms or email. You need to set the following env. You can go to pushplus documentation to get more parameter format detail.
- PUSH_PLUS_KEY: user token. It's required for this service.
- PUSH_PLUS_TOPIC:group id. Send yourself if it's empty. And It's unuseful if
PUSH_PLUS_CHANNEL
equalswebhook
. - PUSH_PLUS_TEMPLATE:Send template
- PUSH_PLUS_CHANNEL:Send channel
- PLUSH_PLUS_WEBHOOK:webhook is required if
PUSH_PLUS_CHANNEL
equalswebhook
orcp
. - PUSH_PLUS_CALLBACKURL:callback url after send responsed.
AUTHOR_EMAIL
: The blogger’s email is used to distinguish whether the posted comment is posted by the blogger himself. If it is posted by the blogger, there will be no reminder notification.SITE_NAME
: Your site name, it will be displayed in notification message.SITE_URL
: Your site url, it will be displayed in notification message.
Discord Notification
We use Discord Webhook to send Discord notification. You need to set the following env.
DISCORD_WEBHOOK
: Discord Webhook url, How to create Discord Webhook url?DISCORD_TEMPLATE
: Send templateAUTHOR_EMAIL
: The blogger’s email is used to distinguish whether the posted comment is posted by the blogger himself. If it is posted by the blogger, there will be no reminder notification.SITE_NAME
: Your site name, it will be displayed in notification message.SITE_URL
: Your site url, it will be displayed in notification message.
Notification Template
Waline supports configuring your customized notification templates for each platform separately to achieve stronger customization capabilities and i18n compatibility.
Supported variables
The template passes parameters through self
, parent
and site
objects, which contain the following variables respectively:
self
: The comment itselfvariable description nick Commenter's nickname mail Commenter's email link Commenter's website url Article address comment Comment cotent commentLink* Links in comments *: commentLink is only provided in Telegram notifications and will be automatically encapsulated in Markdown format.
parent
: Comment which is replied (parent comment).variable description nick Commenter's nickname mail Commenter's email link Commenter's website type Commenter's type comment Comment content site
: Website configurationvariable description name Site name url Site URL postUrl Comment full address
Default template
The default template is attached here for your reference:
QQ_TEMPLATE:
💬 {{site.name|safe}} 有新评论啦 {{self.nick}} 评论道: {{self.comment}} 邮箱: {{self.mail}} 状态: {{self.status}} 仅供评论预览,查看完整內容: {{site.postUrl}}
TG_TEMPLATE:
💬 _[{{site.name}}]({{site.url}}) 有新评论啦_ _{{self.nick}}_ 回复说: ``` {{self.comment-}} ``` {{-self.commentLink}} _邮箱: _\`{{self.mail}}\` _审核: _{{self.status}} 仅供评论预览,点击[查看完整內容]({{site.postUrl}})
Addtional Info
- Vercel’s environment variable size is limited to
4KB
, so if your template is long, you should config if in main entry file, see issue#106. - The specific information of variables may change during the development process. The variable descriptions here are for reference only. Please refer to the specific code examples for specific content.