You include a referral in a cover letter by writing the name of your referral, how you know them, and why they chose to refer you in the first paragraph.
Including details about why they are referring you adds weight to the referral, and allows you to highlight some key qualifications as well.
Cover Letter Referral Example
Dear Hiring Manager,
I’m writing to express my interest in the open Senior Financial Analyst position, which was referred to me by Karl Kieselhorst. During our time together at Kellog’s, Karl would often remark that my expertise in building financial models was essential to the success of the finance department. I now hope to leverage this same expertise to bring success to your company.