public function prepareAttachmentDataForInsert($emailMessageID, $attachment, $attachmentPath, $data=null) {

        $data1 = [];
        $data1['email_messages_id']   = $emailMessageID;
        $data1['attachment_path']     = $attachmentPath;
        $data1['attachment_filename'] = $data['attachment-'.$attachment]->getClientOriginalName();

        if (!empty($data['alternate_sort_string1'])) {
            $data1['alternate_sort_string1'] = $data['alternate_sort_string1'];
        } else {
            $data1['alternate_sort_string1'] = null;
        }

        if (!empty($data['alternate_sort_string2'])) {
            $data1['alternate_sort_string2'] = $data['alternate_sort_string2'];
        } else {
            $data1['alternate_sort_string2'] = null;
        }

        if (!empty($data['comments'])) {
            $data1['comments']         = $data['comments'];
        } else {
            $data1['comments']         = null;
        }

        return $data1;
    }