Galle, LK--:--5/6 sites live

Turn Interest into a WhatsApp Trip Request

Compile the traveller's choices into a pre-written WhatsApp message they review and send themselves — no forms database, no lost emails.

16 Oct 20264 min read#WhatsApp#Conversion#Tourism

Lesson 6 of 10 · Tourism Tech · built from Nora Travels, Nora Labs, Mahesh Travellers and my hospitality sites

In Sri Lanka, email enquiries are where leads go quiet. A guide answers WhatsApp in minutes. So the trip planner's last step doesn't submit a form — it writes the message for you.

Example — building the message

ExampleJavaScript
function prepareRequest(event) {
  event.preventDefault();
  const f = new FormData(event.currentTarget);
  const lines = [
    c.requestIntro, '',
    `${c.requestName}: ${f.get('name').trim()}`,
    `${c.requestDate}: ${f.get('date')}`,
    `${c.requestTravellers}: ${f.get('travellers')}`,
    `${c.requestDuration}: ${c.durationOptions[Number(duration)]}`,
    `${c.requestLanguage}: ${languageNames[lang]}`,
  ];
  if (plan) lines.push(`${c.routeRequest}: ${plan.title[lang]}`);
  if (interests.length) lines.push(`${c.requestInterests}: ${interests.map((k) => c[k]).join(', ')}`);
  lines.push('', c.requestEnd);

  const url = `https://wa.me/<WHATSAPP_NUMBER>?text=${encodeURIComponent(lines.join('\n'))}`;
  window.open(url, '_blank', 'noopener,noreferrer');
}

Why it works

  • Every label is translated (c.requestName, c.requestDate …), so the message arrives in the traveller's language.
  • encodeURIComponent keeps line breaks, accents and emoji intact in the URL.
  • noopener,noreferrer stops the new tab from reaching back into your page.
  • Privacy by design: nothing is stored on the website — the traveller sees exactly what they send.

Clean Air uses the same pattern for AC service quotes: service type, unit and location compiled into one message.

Exercise

Add the selected activities and attractions to the message, but only when the traveller picked at least one. Where in the lines array should they go?


Keep going: ← Lesson 5 · Lesson 7 →

ExerciseKnowledge check

Where are the traveller's enquiry details stored by the Mahesh site?

Finished this one?

Progress is saved in this browser.

Guide