"""
اختبار إرسال إيميل باستخدام Resend API
للحصول على API Key مجاني: https://resend.com/signup
"""
import resend

# احصل على API Key من https://resend.com
resend.api_key = "re_YOUR_API_KEY_HERE"

def send_test_email():
    try:
        params = {
            "from": "SmartLife <onboarding@resend.dev>",  # استخدم domain خاص بك بعد التحقق
            "to": ["ashraffarid@gmail.com"],
            "subject": "SmartLife - Test Email via Resend",
            "html": """
            <html>
            <body dir="rtl" style="font-family: Arial, sans-serif;">
                <h2>🎉 تم بنجاح!</h2>
                <p>هذا بريد إلكتروني تجريبي عبر Resend API.</p>
                <hr>
                <p style="color: #666; font-size: 12px;">SmartLife Monitoring System</p>
            </body>
            </html>
            """
        }
        
        email = resend.Emails.send(params)
        print(f"✓ Email sent! ID: {email['id']}")
        
    except Exception as e:
        print(f"❌ Error: {e}")

if __name__ == "__main__":
    send_test_email()
