(int) $emailTemplate->id, 'type_id' => $emailTemplate->type_id, 'type' => self::getEmail_Type($emailTemplate->type_id), 'receiver_type' => $emailTemplate->receiver_type, 'has_notification_status' => $emailTemplate->has_notification_status, 'should_email_sent_to_all' => $emailTemplate->should_email_sent_to_all, 'message' => $emailTemplate->message, 'subject' => $emailTemplate->subject, 'updated_by' => $emailTemplate->updated_by, 'updated_at' => $emailTemplate->updated_at, ]; return $data; } /** * Retrieves the name of an email type by its ID. * * This function fetches the `name` column for a specific email type * identified by its `type_id`. If the `type_id` is invalid or not provided, * the function returns `null`. * * @since 1.0.0 * * @param int|null $type_id The ID of the email type to retrieve. * @return string|null The name of the email type, or null if not found or invalid. */ public static function getEmail_Type($type_id) { if (!$type_id) { return null; } $email_type = new Email_Type(); $columns = '`name`'; return $email_type->get((int) $type_id, $columns); } }