/**
 * Order Created Email Template
 * 
 * This module is now a thin wrapper around the abstracted email service architecture.
 * All hardcoded values have been moved to configuration files.
 * 
 * Architecture:
 * - types.ts: Type definitions
 * - config.ts: All configurable values (translations, URLs, etc.)
 * - services/paymentMethodService.ts: Payment method detection logic
 * - services/orderTransformerService.ts: Order data transformation
 * - services/emailBuilderService.ts: Email template compilation
 */

import { EmailBuilderService } from "@/lib/email/services/emailBuilderService";
import { emailServiceConfig } from "@/lib/email/config";

/**
 * Generate order created emails (customer + admin)
 * 
 * @param order - Saleor order object
 * @returns EmailResult with customer and admin email content
 * 
 * @example
 * const { customerSubject, customerHtml, adminSubject, adminHtml } = getOrderCreatedEmails(order);
 */
export function getOrderCreatedEmails(order: any) {
  return EmailBuilderService.buildOrderCreatedEmails(order, {
    companyLogoUrl: emailServiceConfig.companyLogoUrl,
    companyName: emailServiceConfig.companyName,
    storefrontUrl: emailServiceConfig.storefrontUrl,
    dashboardUrl: emailServiceConfig.dashboardUrl,
  });
}

// Re-export types for consumers
export type { EmailResult } from "@/lib/email/types";
