Access to metadata in mail template

Hello everybody, nice day!

I want to offer my user the option to override the subject, sender name, and sender email address, but in case they don’t, use the default values that October has in the email configuration and template configuration.
Currently, I’m trying to access the sender name and sender email address values in this way:

// Use custom configuration if available, if not, use default values
$senderName = $mailSettings['sender_name'] ?? config('mail.from.name');
$senderAddress = $mailSettings['sender_address'] ?? config('mail.from.address');
$message->from($senderAddress, $senderName);

How can I access the subject defined in an email template?

subject = 'We received your data '
description = 'Confirmation email '
layout = 'polillastudio.layout'
==
<table id="body" class="body" summary="body" width="100%" height="100%" align="center" border="0" cellspacing="0" cellpadding="0" style="background-color:#E9ECED;">
    <tbody>.........

in order to use it for setting the email subject

$subject = $mailSettings['back_subject'] ?? "subject defined in template";
$message->subject($subject);

thanks for your help

just… enclose $message->subject() only when mail settings for subject is changed. this will always returns subject from mail template :wink: dont overthink simple process