public function buildDataForDatabaseInsert($mappedVars) {

        $data = [];

        $data['priority_id']        = null;
        $data['slug']               = $this->genericCreateSlug($mappedVars['subject']);
        $data['sent']               = 1;
        $data['sent_timestamp']     = Carbon::now();
        $data['read']               = 0;
        $data['archived']           = 0;
        $data['created_at']         = Carbon::now();
        $data['created_by']         = $mappedVars['user_id'];
        $data['updated_at']         = Carbon::now();
        $data['updated_by']         = $mappedVars['user_id'];
        $data['locked_at']          = null;
        $data['locked_by']          = null;

        return $data;
    }
public function buildDataForDatabaseInsert($mappedVars) {

        $data = [];

        $data['priority_id']        = null;
        $data['slug']               = $this->genericCreateSlug($mappedVars['subject']);
        $data['sent']               = 1;
        $data['sent_timestamp']     = Carbon::now();
        $data['read']               = 0;
        $data['archived']           = 0;
        $data['created_at']         = Carbon::now();
        $data['created_by']         = $mappedVars['user_id'];
        $data['updated_at']         = Carbon::now();
        $data['updated_by']         = $mappedVars['user_id'];
        $data['locked_at']          = null;
        $data['locked_by']          = null;

        return $data;
    }
public function buildDataForDatabaseInsert ( $ mappedVars ) { $ data = [ ] ; $ data [ 'priority_id' ] = null ; $ data [ 'slug' ] = $ this -> genericCreateSlug ( $ mappedVars [ 'subject' ] ) ; $ data [ 'sent' ] = 1 ; $ data [ 'sent_timestamp' ] = Carbon :: now ( ) ; $ data [ 'read' ] = 0 ; $ data [ 'archived' ] = 0 ; $ data [ 'created_at' ] = Carbon :: now ( ) ; $ data [ 'created_by' ] = $ mappedVars [ 'user_id' ] ; $ data [ 'updated_at' ] = Carbon :: now ( ) ; $ data [ 'updated_by' ] = $ mappedVars [ 'user_id' ] ; $ data [ 'locked_at' ] = null ; $ data [ 'locked_by' ] = null ; return $ data ; }
Build the data for the INSERT into email_messages.

Some fields are already in the $data array.
These are the db fields that are missing in the $data array.

@param  array   $mappedVars           Inbound POST vars mapped to database fields
@return array
Build the data for the INSERT into email_messages .