Top Activities Email#

Generate HTML email content for top activities recommendations.

Endpoint#

GET marketing/v1/mail-campaign/top-activities-template

Description#

This endpoint generates HTML email content featuring top activity recommendations. It can either use a predefined list of product IDs or dynamically fetch recommendations based on location parameters.

The endpoint returns formatted HTML content suitable for email campaigns, with product information including pricing in the specified currency.

Authorization#

Required Permission: MAIL_CAMPAIGN_API-GET_TOP_ACTIVITIES-ALL

Request Parameters#

Location Parameters (for dynamic recommendations)#

The following parameters are used when productIds is not provided:

Parameter

Type

Required

Description

iataCode

String

Optional

IATA airport code for the destination (e.g., “PAR” for Paris)

cityName

String

Optional

Name of the destination city

destinationId

Long

Optional

Unique identifier for the destination

radius

Double

Optional

Search radius in kilometers around the specified coordinates

lat

Double

Optional

Latitude coordinate for location-based search

lon

Double

Optional

Longitude coordinate for location-based search

Note: When using dynamic recommendations, at least one location parameter (iataCode, cityName, destinationId, or lat/lon pair) should be provided.

Product Parameters#

Parameter

Type

Required

Description

productIds

List<Long>

Optional

List of specific product IDs to include in the email. When provided, location parameters are ignored.

Display Parameters#

Parameter

Type

Required

Description

maxRecommendations

Integer

Optional

Maximum number of recommendations to fetch (defaults to 10 if not provided). Values higher than 10 will be automatically capped at 10 to ensure optimal email performance and user experience.

currencyCode

String

Optional

ISO currency code for price display (e.g., “EUR”, “USD”). Defaults to EUR if not provided or invalid.

Request Examples#

Example 1: Using Specific Product IDs#

GET marketing/v1/mail-campaign/top-activities-template?productIds=12345,67890,11223&currencyCode=USD

Example 2: Dynamic Recommendations by City#

GET marketing/v1/mail-campaign/top-activities-template?cityName=Paris&currencyCode=EUR

Example 3: Dynamic Recommendations by IATA Code#

GET marketing/v1/mail-campaign/top-activities-template?iataCode=NYC&maxRecommendations=10&currencyCode=USD

Example 4: Dynamic Recommendations by Coordinates#

GET marketing/v1/mail-campaign/top-activities-template?lat=48.8566&lon=2.3522&radius=5.0&currencyCode=EUR

Response#

Content-Type#

text/html

Success Response#

Code: 200 OK

Content: HTML formatted email content ready for email campaign distribution.

The HTML content includes:

  • Structured layout optimized for email clients

  • Product images and descriptions

  • Pricing information in the requested currency

  • Call-to-action buttons

  • Responsive design for mobile and desktop email clients

Error Responses#

Code

Description

400

Bad Request - Invalid input parameters or validation failed

401

Unauthorized - Missing or invalid authentication

403

Forbidden - Insufficient permissions to access this endpoint

404

Not Found - Specified products or destination not found

500

Internal Server Error - Server error during processing

Behavior Notes#

  1. Product ID Priority: When productIds is provided, the endpoint uses those specific products and ignores all location-based parameters.

  2. Dynamic Recommendations: When productIds is not provided, the endpoint fetches recommendations based on location parameters. The system validates that appropriate location parameters are present.

  3. Product Limit: The maxRecommendations parameter is respected but automatically capped at a maximum of 10 products to ensure optimal email performance and user experience. If you request more than 10, the system will return exactly 10. If not provided, defaults to 10.

  4. Currency Handling:

    • The system validates the provided currency code against supported currencies

    • Invalid or unsupported currencies default to EUR

    • Prices are converted to the requested currency for display

  5. Locale: The email content language is determined by the request context locale, defaulting to English if not specified.

  6. HTML Output: The generated HTML is optimized for email clients and includes inline styles for maximum compatibility.

Use Cases#

  • Personalized email campaigns featuring destination-specific activities

  • Promotional emails with curated activity selections

  • Follow-up emails after destination searches

  • Geographic-targeted marketing campaigns