From 2ee244a354a6f5b6103267832f86348e1a7ff60a Mon Sep 17 00:00:00 2001 From: Ryderjj89 Date: Mon, 26 May 2025 18:19:52 -0400 Subject: [PATCH] Improve ICS calendar generation and email button styling - Changed default event duration from 2 hours to 4 hours - Fixed location field escaping issue that was adding unwanted backslashes - Updated 'Add to Calendar' button styling to remove green background - Button now uses blue border and text instead of solid green background - Location field in ICS files now displays properly without escape characters --- backend/src/email.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/src/email.ts b/backend/src/email.ts index 3841087..a48d977 100644 --- a/backend/src/email.ts +++ b/backend/src/email.ts @@ -14,8 +14,8 @@ export function generateICSContent(eventData: { const eventDate = new Date(date); const startDate = eventDate.toISOString().replace(/[-:]/g, '').replace(/\.\d{3}/, ''); - // Set end time to 2 hours after start time (default duration) - const endDate = new Date(eventDate.getTime() + 2 * 60 * 60 * 1000); + // Set end time to 4 hours after start time (default duration) + const endDate = new Date(eventDate.getTime() + 4 * 60 * 60 * 1000); const endDateFormatted = endDate.toISOString().replace(/[-:]/g, '').replace(/\.\d{3}/, ''); // Generate unique ID for the event @@ -35,8 +35,7 @@ export function generateICSContent(eventData: { // Clean location for ICS format const cleanLocation = location .replace(/,/g, '\\,') - .replace(/;/g, '\\;') - .replace(/\\/g, '\\\\'); + .replace(/;/g, '\\;'); // Clean title for ICS format const cleanTitle = title @@ -176,7 +175,7 @@ export async function sendRSVPEditLinkEmail(data: RSVPEditLinkEmailData) {

${editLink}

+ style="color: #0066cc; padding: 12px 24px; text-decoration: none; border: 2px solid #0066cc; border-radius: 4px; display: inline-block; font-weight: bold;"> 📅 Add to Calendar!