I have an undergraduate student who has been working in my lab for quite some time, doing relatively advanced work and has even been able to mentor other students in getting up to speed in the workings of the lab and the methods we use. I never had this student in a class, but they approached me in their second year asking if I had any opportunities and I was happy to provide an unpaid opportunity and the following year a student job for them after seeing their exceptional work.
This student is now applying to graduate school and has asked me to write them a recommendation letter, and I said I would be happy to do so since the student has demonstrated competence and has even started asking quite interesting research questions related to our work. As part of the recommendation process I always ask for the application materials, including transcripts, personal statement and so on. Upon looking at the transcripts I found out the student has a very bad academic history and has even recently been on academic probation. They got C's in classes closely related to our subject (but taught by people I don't know well in the department). I'm not sure what to think or whether to include that as part of my recommendation letter, or to ignore it overall?