Merge pull request #285 from qinfendebingshuo/copilot/fix-zhu-yuan-20-error
fix: V2 subscription send missing `send` action arg + URL override not wired
This commit is contained in:
commit
654860b5a6
|
|
@ -303,7 +303,7 @@ jobs:
|
|||
${{ secrets.ZY_BRAIN_USER }}@${{ secrets.ZY_BRAIN_HOST }} \
|
||||
"export ZY_SMTP_USER='${ZY_SMTP_USER}' ZY_SMTP_PASS='${ZY_SMTP_PASS}' && \
|
||||
cd /opt/zhuyuan-brain/proxy && \
|
||||
node service/send-subscription.js '$EMAIL' '$SUB_URL'" || {
|
||||
node service/send-subscription.js send '$EMAIL' '$SUB_URL'" || {
|
||||
echo ""
|
||||
echo "⚠️ 邮件发送失败,请手动将以下订阅链接发送给用户:"
|
||||
echo " $SUB_URL"
|
||||
|
|
|
|||
|
|
@ -125,8 +125,8 @@ function detectSmtpHost(email) {
|
|||
}
|
||||
|
||||
// ── 生成订阅邮件HTML ─────────────────────────
|
||||
function generateSubscriptionEmail(config) {
|
||||
const subUrl = `http://${config.server_host}/api/proxy-sub/sub/${config.sub_token}`;
|
||||
function generateSubscriptionEmail(config, urlOverride) {
|
||||
const subUrl = urlOverride || `http://${config.server_host}/api/proxy-sub/sub/${config.sub_token}`;
|
||||
const now = new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' });
|
||||
|
||||
return `
|
||||
|
|
@ -226,7 +226,7 @@ function generateAlertEmail(message) {
|
|||
|
||||
// ── 主入口 ───────────────────────────────────
|
||||
async function main() {
|
||||
const [,, action, target] = process.argv;
|
||||
const [,, action, target, urlOverride] = process.argv;
|
||||
|
||||
if (!action) {
|
||||
console.log('用法:');
|
||||
|
|
@ -245,7 +245,7 @@ async function main() {
|
|||
}
|
||||
|
||||
console.log(`📧 发送订阅链接到: ${email}`);
|
||||
const html = generateSubscriptionEmail(config);
|
||||
const html = generateSubscriptionEmail(config, urlOverride);
|
||||
|
||||
try {
|
||||
await sendEmail(email, '🏛️ 铸渊专线 · 订阅链接', html);
|
||||
|
|
|
|||
Loading…
Reference in New Issue