<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Utilities\ApiCalls;
use App\Utilities\SmsLibrary;
use App\Services\MicrosoftMailService;

class UtilityController extends Controller
{
    public function sendSms(){
        // code...

        $sms_message = "Hello Susana your LUPMIS account has been successfully created\n";
        $sms_message .= "Username :  . sussie \n";
        $sms_message .= "Password : securepass\n";
        $sms_message .= 'Login URL : https://lupmis4luspa.org'; 
        $sms_data = [
            'recipient' => '0555344661',
            'message' => $sms_message
        ];
        $sms_result = SmsLibrary::SendMnotitySms($sms_data);

        \Log::info("SMS API Response : $sms_result");
    }

    public function testMSEmail(MicrosoftMailService $mailService)
    {
        $mailService->sendEmail(
            'kwesilabs@outlook.com', 
            'Test from LUPMIS', 
            '<h1>Hello!</h1><p>This is sent via Microsoft Graph API.</p>'
        );
        
        return 'Email sent!';
    }
}
