In the digitalization era, e-commerce plays a crucial role in the economy, followed by the internet and smartphone technology. Also, it has a positive effect on humankind. Indonesia has reported the highest e-commerce adoption in the world. However, limited previous studies utilize customer relationship management (CRM) as a mediator in influencing online purchase intention. The present study seeks to analyze the mediating role of CRM in the relationship of digital marketing and online trust on the online purchase intention of e-commerce customers in Banda Aceh city, Aceh province, Indonesia. This study involved all the customers of e-commerce companies in Banda Aceh City. The sample was determined by using a rule of thumb. A total of 150 respondents participated and were collected using purposive sampling. The results indicated that Digital Marketing and Online Trust have a significant positive relationship with CRM. Also, Digital Marketing and CRM have a significant relationship with online purchase intention. Unfortunately, Online trust does not significantly affect online consumer purchase intention. In addition, the CRM mediates the relationship of digital marketing and online trust towards the online purchase intention of e-commerce consumers in Banda Aceh, Aceh Province, Indonesia. This study concludes that CRM plays a role as a mediator in the relationship of the studied variables on the online purchase intention of e-commerce consumers. Also, this study has successfully analyzed the factors that influence online purchase intention and proved the role of CRM.