master

laravel/framework

Last updated at: 29/12/2023 09:24

MessageSending.php

TLDR

This file defines a class called MessageSending in the Illuminate\Mail\Events namespace. The class has two properties ($message and $data) and a constructor method that sets the initial values of the properties.

Classes

MessageSending

The MessageSending class represents an event that is fired when a message is being sent. It has the following properties:

  • $message: This property holds an instance of the Symfony\Component\Mime\Email class, which represents the email message being sent.
  • $data: This property holds an array of additional data related to the message.

The class also has a constructor method that takes an instance of the Symfony\Component\Mime\Email class and an optional array of data as parameters. It initializes the $message and $data properties with the provided values.

<?php

namespace Illuminate\Mail\Events;

use Symfony\Component\Mime\Email;

class MessageSending
{
    /**
     * The Symfony Email instance.
     *
     * @var \Symfony\Component\Mime\Email
     */
    public $message;

    /**
     * The message data.
     *
     * @var array
     */
    public $data;

    /**
     * Create a new event instance.
     *
     * @param  \Symfony\Component\Mime\Email  $message
     * @param  array  $data
     * @return void
     */
    public function __construct(Email $message, array $data = [])
    {
        $this->data = $data;
        $this->message = $message;
    }
}