unsubscribe

This commit is contained in:
romantarkin 2025-08-19 12:50:05 +05:00
parent e36042e24d
commit 72a631c6c1

View File

@ -0,0 +1,24 @@
// Тестовый скрипт для проверки генерации ссылки отписки
const domain = 'example.com';
const email = 'test@example.com';
// HTML версия ссылки отписки
const unsubscribeLink = `
<div style="margin-top: 30px; padding-top: 20px; border-top: 1px solid #e5e7eb; text-align: center; font-size: 12px; color: #6b7280;">
<p style="margin: 0 0 10px 0;">Если вы больше не хотите получать наши письма, вы можете
<a href="https://${domain}/unsubscribe?email=${encodeURIComponent(email)}" style="color: #ef4444; text-decoration: none;">отписаться от рассылки</a>.
</p>
</div>
`;
// Текстовая версия ссылки отписки
const textWithUnsubscribe = `Это тестовое письмо.\n\n---\nЕсли вы больше не хотите получать наши письма, вы можете отписаться от рассылки: https://${domain}/unsubscribe?email=${encodeURIComponent(email)}`;
console.log('=== HTML версия ссылки отписки ===');
console.log(unsubscribeLink);
console.log('\n=== Текстовая версия ссылки отписки ===');
console.log(textWithUnsubscribe);
console.log('\n=== Ссылка для отписки ===');
console.log(`https://${domain}/unsubscribe?email=${encodeURIComponent(email)}`);