array( 'title' => __( 'New Registration Notification', 'hvac-community-events' ), 'description' => __( 'Sent to administrators when a new trainer registers', 'hvac-community-events' ), 'placeholders' => array( '{trainer_name}' => 'Trainer full name', '{trainer_email}' => 'Trainer email address', '{business_name}' => 'Business name', '{business_phone}' => 'Business phone', '{business_email}' => 'Business email', '{registration_date}' => 'Registration date', '{application_details}' => 'Application details', '{approval_url}' => 'Quick approval link', ), ), 'account_approved' => array( 'title' => __( 'Account Approved', 'hvac-community-events' ), 'description' => __( 'Sent to trainers when their account is approved', 'hvac-community-events' ), 'placeholders' => array( '{trainer_name}' => 'Trainer full name', '{trainer_email}' => 'Trainer email address', '{business_name}' => 'Business name', '{dashboard_url}' => 'Dashboard URL', '{login_url}' => 'Login page URL', '{website_name}' => 'Website name', '{website_url}' => 'Website URL', ), ), 'account_disabled' => array( 'title' => __( 'Account Disabled', 'hvac-community-events' ), 'description' => __( 'Sent to trainers when their account is disabled', 'hvac-community-events' ), 'placeholders' => array( '{trainer_name}' => 'Trainer full name', '{trainer_email}' => 'Trainer email address', '{business_name}' => 'Business name', '{support_email}' => 'Support email address', '{website_name}' => 'Website name', ), ), ); ?>

$definition ): ?> get_default_templates(); $default_subject = isset($defaults[$key]['subject']) ? $defaults[$key]['subject'] : ''; $default_body = isset($defaults[$key]['body']) ? $defaults[$key]['body'] : ''; $subject = isset( $templates[$key]['subject'] ) ? $templates[$key]['subject'] : $default_subject; $body = isset( $templates[$key]['body'] ) ? $templates[$key]['body'] : $default_body; ?>

$template ) { if ( isset( $template['subject'] ) ) { $sanitized[$key]['subject'] = sanitize_text_field( $template['subject'] ); } if ( isset( $template['body'] ) ) { $sanitized[$key]['body'] = wp_kses_post( $template['body'] ); } } return $sanitized; } /** * Get default email templates */ public function get_default_templates() { return array( 'new_registration' => array( 'subject' => 'New Trainer Registration - {trainer_name}', 'body' => '

Hello Administrator,

A new trainer has registered and is awaiting approval:

Trainer Information:
Name: {trainer_name}
Email: {trainer_email}
Business: {business_name}
Phone: {business_phone}
Business Email: {business_email}
Registration Date: {registration_date}

Application Details:
{application_details}

Action Required:
Please review this trainer\'s application and approve or deny their access.

Review Application

Best regards,
{website_name}

' ), 'account_approved' => array( 'subject' => 'Welcome to {website_name} - Your Trainer Account is Approved!', 'body' => '

Dear {trainer_name},

Great news! Your trainer account for {business_name} has been approved.

You can now access your trainer dashboard to:

Get Started:
Go to Your Dashboard

If you need to log in again, visit: {login_url}

We\'re excited to have you as part of our community of HVAC trainers!

If you have any questions or need assistance, please don\'t hesitate to reach out.

Best regards,
The {website_name} Team

' ), 'account_disabled' => array( 'subject' => 'Your {website_name} Trainer Account Has Been Disabled', 'body' => '

Dear {trainer_name},

We\'re writing to inform you that your trainer account for {business_name} has been temporarily disabled.

This may be due to:

If you believe this was done in error or would like to discuss reactivating your account, please contact us at {support_email}.

We value your participation in our trainer community and look forward to resolving this matter.

Best regards,
The {website_name} Team

' ), ); } /** * Enqueue admin scripts and styles */ public function enqueue_admin_scripts( $hook ) { // Only load on our settings page if ( strpos( $hook, 'hvac-community-events' ) === false ) { return; } // Add custom CSS wp_add_inline_style( 'wp-admin', ' .hvac-email-templates-settings .email-template-section { background: #fff; border: 1px solid #e5e5e5; padding: 20px; margin-bottom: 20px; } .hvac-email-templates-settings .placeholders-info { background: #f5f5f5; padding: 15px; margin: 15px 0; border-radius: 3px; } .hvac-email-templates-settings .placeholders-list { margin-top: 10px; line-height: 1.8; } .hvac-email-templates-settings .placeholders-list code { background: #fff; padding: 2px 5px; border: 1px solid #ddd; } .hvac-email-templates-settings .email-template-preview { margin-top: 40px; background: #f9f9f9; padding: 20px; border-radius: 3px; } ' ); // Add preview functionality wp_add_inline_script( 'jquery', ' jQuery(document).ready(function($) { // Preview functionality could be added here // For now, just a placeholder }); ' ); } }