The purpose of this study is to propose an e-learning system model for learning content personalisation based on students’ emotions. The proposed system collects learners’ brainwaves using a portable Electroencephalogram and processes them via a supervised machine learning algorithm, named K-nearest neighbours (KNN), to recognise real-time emotional status. Besides, it uses a reinforcement learning approach to analyse the learners’ emotional states and automatically recommend the best-fitted content that keeps the students in a positive mood. The performance of the proposed system is evaluated in two forms: 1) the system performance and 2) student engagement, satisfaction, and learning. A convenience sampling method is used to select 30 students from the pollution of 281 PartII-undergraduate students who study computer science during the 2020-21 academic year at the University of Nottingham Ningbo China. The selected students are divided into homogenous control and experimental groups for learning English listening and reading skills. According to the machine learning results, the trained KNN recognises the emotional states with an accuracy of 74.3%, the precision of 70.8%, and recall of 69.3%. In addition, the results of the t-Test demonstrate that the proposed e-learning system model has no significant impact on learners’ learning and engagement but enhances the student’s satisfaction compared to traditional e-learning systems (p < 0.05).