Son of William Temple (1710-1774), twice mayor of Berwick-upon-Tweed, and Sarah Johnson (d. ca. 1747). Brother of Robert Temple. William Johnston Temple enrolled at Edinburgh University in 1756, which is where he met Boswell. In 1765 he earned his LL.B. from Cambridge. In 1766 he was ordained a Deacon and received the rectory of Mamhead near Exeter, at which he stayed until 1776. In 1767 he married Anne Stow in Berwick-upon-Tweed. From 1770 and onwards he had occasional financial and marital difficulties and stayed with Boswell on some occasions. In 1776 he became Vicar in Gluvius, Cornwall. He and Anne had 8 children (6 boys, 2 girls). One (named after his father) died aged 18 in 1787. Anne died in 1793 and William himself died on August 13th, 1796.
William Johnson Temple was not related to Sir William Temple (1628-1699), who is occasionally mentioned in Boswell in Holland.1 He was, however, the grandfather and great-grandfather respectively of the two archbishops of Canterbury, Frederick Temple (1821-1902) and William Temple (1881-1944)
Boswell first met Temple in Robert Hunter's Greek class at the University of Edinburgh in 1755. They remained close friends for the rest of their lives, and their collected correspondence has been published. When Boswell arrived in London in 1762 he hadn't seen Temple for two years, and their correspondence, apparently, had stopped. Boswell went to visit Temple on November 27, 1762, but Temple wasn't in, and they didn't meet again until April 02, 1763.
Having renewed their friendship, Boswell and Temple kept corresponding for the years to come, in between long periods of physical absence. Especially illuminating are the letters between the two written between the years 1766 and 1769, central years in Boswell's life where he was admitted advocate, authored his first major work, An Account of Corsica, and courted and married his cousin, Margaret Montgomerie. Boswell's journal is missing or non-existent for a large part of this period, wherefore several of the letters between him and Temple are printed in the Yale edition dealing with these years, Boswell in Search of a Wife.
The Correspondence of William Johnson Temple and James Boswell, one of the Yale volumes of Boswell's papers, was published in 1997. This wasn't the first publication of their letters, however. As early as the 1850s most of their correspondence had been printed. Temple's own diary for the years 1780-1796 was published by the Clarendon Press in 1929, ed. by Lewis Bettany, and is fairly rare but sometimes available from antique bookshops via AbeBooks.