He was born in
Paisley on 9 May 1819, the son of Daniel Cunningham, an ironmonger, living and working at 53 High Street. He was educated at
Paisley Grammar School then studied divinity at both
Glasgow University and
Edinburgh University. At the latter he won Prof Wilson's prize for poetry with his poem "The Hearth and the Altar". He was licensed to preach by the Presbytery of the
Church of Scotland in Paisley in 1845. He worked briefly in Lanark then was ordained at
Crieff in August 1845. He served as minister of Crieff Parish Church for 41 years. In 1860 Edinburgh University awarded him an
honorary doctorate (DD). In 1867 he came to fame whilst still at Crieff in a court case known as the "Crieff Organ Case", where he won the right to install an organ in his church. The court case caused a wave of church organs to be installed across Scotland. In 1886 he succeeded Very Rev
Alexander Ferrier Mitchell as
Moderator of the General Assembly of the Church of Scotland. He was elected Principal of
St Mary's College, St Andrews in the same year (replacing
John Tulloch) and also awarded a further doctorate (LLD) from Glasgow University. In 1887 he got a third doctorate (LLD) from
Trinity College, Dublin. He died in
St Andrews on 1 September 1893. ==Family==