You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug]: 邮件提醒里的超链接错误,导致不能通过邮件直达评论地址 || [Bug]: The hyperlink in the email reminder is wrong, resulting in the comment address not being directly accessible via email.
#2144
Closed
skyreeves opened this issue
Nov 7, 2023
· 1 comment
The email reminder is set to click Go to the original text to view the complete comment content. Just like the current hyperlink, it is wrong. There should be a / between com and about.
So I changed the value of SITE_URL from https://skyreeves.com to https://skyreeves.com/ in the Vercle environment variable and found that the problem could be solved and the hyperlink became normal.
But a new problem arises. As a result, the hyperlink in the email reminder for comments in the article will become https://skyreeves.com//post/xxx, and there is an extra / after com, causing the hit not open.
The official template used for email reminders has not configured the four related environment variables. It may be that the size exceeds the limit of Vercle and will fail, so I wrote it in Github's index.js:
const Application = require('@waline/vercel');
module.exports = Application({
mailSubject: '{{parent.nick | safe}}, your comment on "{{site.name | safe}}" received a reply',
mailTemplate: `
<div style="border-top:2px solid #12ADDB;box-shadow:0 1px 3px #AAAAAA;line-height:180%;padding:0 15px 12px;margin:50px auto;font-size:12px;">
<h2 style="border-bottom:1px solid #DDD;font-size:14px;font-weight:normal;padding:13px 0 10px 8px;">
Your blog <a style="text-decoration:none;color: #12ADDB;" href="{{site.url}}" target="_blank">{{site.name}}</a> There is a new reply to the comment
</h2>
<div style="padding:0 12px 0 12px;margin-top:18px">
<p>{{parent.nick}}, you commented:</p>
<div style="background-color: #f5f5f5;padding: 10px 15px;margin:18px 0;word-wrap:break-word;">{{parent.comment | safe}}</div>
<p><strong>{{self.nick}}</strong> replied:</p>
<div style="background-color: #f5f5f5;padding: 10px 15px;margin:18px 0;word-wrap:break-word;">{{self.comment | safe}}</div>
<p>You can click <a style="text-decoration:none; color:#12addb" href="{{site.postUrl}}" target="_blank">to view the full reply content</a> , welcome to visit again<a style="text-decoration:none; color:#12addb" href="{{site.url}}" target="_blank">{{site.name}}</a>. </p>
<br/>
</div>
<div style="border-top:1px solid #DDD; padding:13px 0 0 8px;">
This email is automatically sent by the system, please do not reply directly.
</div>
<br/>
</div>`,
mailSubjectAdmin: 'Your blog "{{site.name | safe}}" has received new comments',
mailTemplateAdmin: `
<div style="border-top:2px solid #12ADDB;box-shadow:0 1px 3px #AAAAAA;line-height:180%;padding:0 15px 12px;margin:50px auto;font-size:12px;">
<h2 style="border-bottom:1px solid #DDD;font-size:14px;font-weight:normal;padding:13px 0 10px 8px;">
Someone posted something new at <a style="text-decoration:none;color: #12ADDB;" href="{{site.url}}" target="_blank">{{site.name}}</a> comment of
</h2>
<div style="padding:0 12px 0 12px;margin-top:18px">
<p><strong>{{self.nick}}</strong> commented:</p>
<div style="background-color: #f5f5f5;padding: 10px 15px;margin:18px 0;word-wrap:break-word;">{{self.comment | safe}}</div>
<p>You can click <a style="text-decoration:none; color:#12addb" href="{{site.postUrl}}" target="_blank"> to view the full review content. </a></p>
<br/>
</div>
<div style="border-top:1px solid #DDD; padding:13px 0 0 8px;">
This email is automatically sent by the system, please do not reply directly.
</div>
<br/>
</div>`
});
In addition, I checked the comment data in Leancloud and found that as long as the comment is in the article, the link is displayed as "url": "/post/xxx.html, while the comment link on the About page is displayed as "url": "about". Is it caused by missing a / here?
So I exported the data, changed the relevant part to "url": "/about", and then imported it back, but the comment data was lost.
I originally set the comment id on the About page: comment_id: 'about'. I changed it to comment_id: '/about'. After testing, I found that the data link of Leancloud is still displayed as "url": " about". So my guess may be wrong.
Other blogs using hexo with the same theme as mine don't have this problem.
github-actionsbot
changed the title
[Bug]: 邮件提醒里的超链接错误,导致不能通过邮件直达评论地址
[Bug]: 邮件提醒里的超链接错误,导致不能通过邮件直达评论地址 || [Bug]: The hyperlink in the email reminder is wrong, resulting in the comment address not being directly accessible via email.
Nov 7, 2023
Currently, the generation of the complete URL of the email reminder relies on the unspoken rule that comment_id needs to be the pathname of the current URL. You need to set the comment_id of your page to /about, and the SITE_URL will remain normal without adding the / suffix. In addition, configuration modifications here will not affect historical data, and historical comments need to be manually modified and migrated.
问题描述 | Describe the bug
邮件提醒里设置了点击前往原文查看完整的评论内容。也正如现在这个超链接,它是错误的,在
com
和about
之间应该还有一个/
才对。于是我在Vercle的环境变量里将SITE_URL的值从
https://skyreeves.com
改为https://skyreeves.com/
,发现问题可以解决,超链接就正常了。但新的问题出现了,这样一来在文章里的评论,得到的邮件提醒超链接会变成
https://skyreeves.com//post/xxx
,com后面多了一个/
导致打不开。邮件提醒使用的官方模板,相关的4个环境变量没有配置,可能是大小超过了Vercle的限制,会失败,所以我是写在Github的
index.js
里:另外,我在Leancloud里查看评论数据,发现只要是在文章里的评论,链接显示为
"url": "/post/xxx.html
,而在关于页面的评论链接显示为"url": "about"
。是不是这里少了一个/
导致的。于是我将数据导出,将相关的部分修改为
"url": "/about"
,再导入回,结果评论数据丢失。我原本关于页面设置了评论id:
comment_id: 'about'
,我将其改为comment_id: '/about'
,测试发现Leancloud 的数据链接还是显示为"url": "about"
。所以我的猜想可能是错的。其他使用hexo,与我相同主题的博客都没有这个问题。
问题网站 | Website URL
https://skyreeves.com/about
服务部署在哪里? | Where your waline deploy?
Vercel (Default)
数据存储在哪里?| Where your comment data store?
LeanCloud(https://leancloud.cn)
Problem description | Describe the bug
The email reminder is set to click Go to the original text to view the complete comment content. Just like the current hyperlink, it is wrong. There should be a
/
betweencom
andabout
.So I changed the value of SITE_URL from
https://skyreeves.com
tohttps://skyreeves.com/
in the Vercle environment variable and found that the problem could be solved and the hyperlink became normal.But a new problem arises. As a result, the hyperlink in the email reminder for comments in the article will become
https://skyreeves.com//post/xxx
, and there is an extra/
after com, causing the hit not open.The official template used for email reminders has not configured the four related environment variables. It may be that the size exceeds the limit of Vercle and will fail, so I wrote it in Github's
index.js
:In addition, I checked the comment data in Leancloud and found that as long as the comment is in the article, the link is displayed as
"url": "/post/xxx.html
, while the comment link on the About page is displayed as"url": "about"
. Is it caused by missing a/
here?So I exported the data, changed the relevant part to
"url": "/about"
, and then imported it back, but the comment data was lost.I originally set the comment id on the About page:
comment_id: 'about'
. I changed it tocomment_id: '/about'
. After testing, I found that the data link of Leancloud is still displayed as"url": " about"
. So my guess may be wrong.Other blogs using hexo with the same theme as mine don't have this problem.
Question Website | Website URL
https://skyreeves.com/about
Where is the service deployed? | Where your waline deploy?
Vercel (Default)
Where is the data stored? | Where your comment data store?
LeanCloud(https://leancloud.cn)
The text was updated successfully, but these errors were encountered: