Nowadays, companies offer product bundles with special discounts in order to sell more products. However, it is important to note that customers show different levels of loyalties to companies, and each segment of the market has unique features, which influences the customers' buying patterns. The primary purpose of this paper is to propose a novel model for product bundling in e-commerce websites by using market segmentation variables and customer loyalty analysis. RFM model is employed to calculate customer loyalty. Subsequently, the customers are grouped based on their loyalty levels. Each group is then divided into different segments based on market segmentation variables. The product bundles are determined for each market segment via clustering algorithms. Apriori algorithm is also used to determine the association rules for each product bundle. Classification models are applied in order to determine which product bundle should be recommended to each customer. The results demonstrate that the silhouette coefficient, support, confidence, and accuracy values are higher when both customer loyalty level and market segmentation variables are used in product bundling. Accordingly, the proposed model increases the chance of success in direct marketing and recommending product bundles to customers.