Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def generate_personalized_email(customer_data, travel_trends):
- prompt = f"""
- Generate a personalized email for a travel company customer with the following profile:
- - Name: {customer_data['name']}
- - Past destinations: {', '.join(customer_data['past_destinations'])}
- - Preferred travel style: {customer_data['travel_style']}
- - Budget: ${customer_data['budget']}
- Current travel trends:
- {travel_trends}
- The email should include:
- 1. A personalized greeting
- 2. 2-3 travel recommendations based on the customer's profile and current trends
- 3. A brief explanation of why each recommendation suits the customer
- 4. A call-to-action to book a trip
- Keep the tone friendly and engaging.
- """
- response = llm.generate(prompt)
- return response.text
- # Example usage
- customer = {
- "name": "Emma",
- "past_destinations": ["Japan", "Italy", "Mexico"],
- "travel_style": "cultural experiences",
- "budget": 5000
- }
- travel_trends = """
- - Sustainable tourism is on the rise
- - Off-the-beaten-path destinations are gaining popularity
- - Wellness retreats are trending
- """
- personalized_email = generate_personalized_email(customer, travel_trends)
- print(personalized_email)
Advertisement
Add Comment
Please, Sign In to add comment