Formal Invitation Letter Generator
Configure details in the Data Configuration tab and click "Generate Invitation" to see your formal letter here.
' + p.trim() + '
'; }).join(''); }; var formatDateRange = function(start, end) { if (!start || !end) return "[DATE RANGE N/A]"; try { var startDate = new Date(start); var endDate = new Date(end); var options = { year: 'numeric', month: 'long', day: 'numeric' }; return startDate.toLocaleDateString('en-US', options) + ' to ' + endDate.toLocaleDateString('en-US', options); } catch(e) { return start + ' to ' + end; } }; var generateLetter = function() { var data = { senderName: senderNameInput.value || "[Host Name]", senderTitle: senderTitleInput.value || "[Host Title/Affiliation]", senderAddress: senderAddressInput.value || "[Host Address]", recipientName: recipientNameInput.value || "[Invitee Name]", recipientTitle: recipientTitleInput.value || "", recipientAddress: recipientAddressInput.value || "[Invitee Address]", startDate: startDateInput.value, endDate: endDateInput.value, purpose: purposeInput.value || "The purpose of this visit has not been detailed.", financialSupport: financialSupportInput.value || "All travel and living expenses will be the responsibility of the invitee." }; var today = new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }); var dateRangeText = formatDateRange(data.startDate, data.endDate); var recipientBlock = data.recipientTitle ? data.recipientName + '' + data.recipientTitle : data.recipientName; var letterHtml = `
${data.senderTitle}
${data.senderAddress.replace(/\n/g, '
')}
${data.recipientAddress.replace(/\n/g, '
')}
Dear ${data.recipientName.split(' ')[0]},
This letter serves as a formal invitation for you to visit us in the United States, hosted by ${data.senderName}, ${data.senderTitle}. Your intended visit is scheduled to begin on ${dateRangeText.split(' to ')[0]} and conclude on ${dateRangeText.split(' to ')[1]}.
The purpose of your trip is strictly professional/academic: ${formatParagraphs(data.purpose)} Your presence is highly valued as it will directly contribute to our ongoing work in [Topic Area].
Regarding financial arrangements, ${data.financialSupport}. We confirm that you will be provided with adequate means to support your entire stay.
We urge you to use this document to support your visa application or official permissions. Please contact me directly if any additional documentation or information is required. We look forward to your visit.
Sincerely,
