<?php

namespace App\Mail;

use Illuminate\Mail\Mailable;

class SendScreenshotMail extends Mailable
{
    public $imageName;

    // ✅ constructor (image receive karne ke liye)
    public function __construct($imageName)
    {
        $this->imageName = $imageName;
    }

    // ✅ YEHI AAPKA build() FUNCTION HAI
    public function build()
    {
      return $this->subject('Great News: We Got Custom 360')
        ->view('emails.screenshot')
        ->attach(public_path('screenshots/' . $this->imageName))
        ->with([
            'imagePath' => public_path('screenshots/' . $this->imageName)
        ]);
    }
}