<?php
/**
 * Service : Gestion des emails transactionnels
 */

if ( ! defined( 'ABSPATH' ) ) exit;

if ( ! class_exists( 'Avision_Emailer' ) ) {

    class Avision_Emailer {

        public static function send_audit_confirmation( $to_email, $company_name ) {
            $subject = sprintf( __( 'Your SEO Audit: %s', 'avision' ), $company_name );
            
            $message  = "Hello,\n\n";
            $message .= "Your SEO audit for " . $company_name . " has been saved.\n";
            $message .= "You can access your dashboard anytime using your email.\n\n";
            $message .= "The Avision Team.";

            $headers = array('Content-Type: text/plain; charset=UTF-8');

            return wp_mail( $to_email, $subject, $message, $headers );
        }
    }
}
