protected function getSubject()
    {
        // the form could contain arrays which are incompatible with the template function
        $templatableItems = array_filter($this->form->data(), function ($item) {
            return is_scalar($item);
        });

        $subject = Str::template($this->option('subject', I18n::translate('uniform-email-subject')), $templatableItems);

        // Remove newlines to prevent malicious modifications of the email header.
        return str_replace("\n", '', $subject);
    }