Emanuel Swedenborg (1688 – 1772) was a Swedish scientist, philosopher, Christian mystic and theologian. Swedenborg had a prolific career as an inventor and scientist. At the age of fifty-six he entered into a spiritual phase, in which he experienced dreams and visions. This culminated in a spiritual awakening, where he claimed he was appointed by the Lord to write a heavenly doctrine to reform Christianity. He claimed that the Lord had opened his eyes, so that from then on he could freely visit heaven and hell, and talk with angels, demons, and other spirits. For the remaining 28 years of his life, he wrote and published 18 theological works, of which the best known was Heaven and Hell (1758) , and several unpublished theological works.
Around 1744 he began having strange dreams. Swedenborg carried a travel journal with him on most of his travels, and did so on this journey. The whereabouts of the diary were long unknown, but it was discovered in the Royal Library in the 1850s and published in 1859 as Drömboken, or Journal of Dreams. It provides a first-hand account of the events of the crisis.
He experienced many different dreams and visions, some greatly pleasurable, others highly disturbing. The experiences continued as he travelled to London to continue the publication of Regnum animale. This cathartic process continued for six months. It has been compared to the Catholic concept of Purgatory. Analyses of the diary have concluded that what Swedenborg was recording in his Journal of Dreams was a battle between the love of his self, and the love of God. 
In the last entry of the journal from October 26-27 1744, Swedenborg appears to be clear as to which path to follow. He felt he should drop his current project, and write a new book about the worship of God. He soon began working on De cultu et amore Dei, or The Worship and Love of God. It was never fully completed, but Swedenborg still had it published in London in June 1745.
One explanation why the work was never finished is given in a well known and often referenced story. In April 1745, Swedenborg was dining in a private room at a tavern in London. By the end of the meal, a darkness fell upon his eyes, and the room shifted character. Suddenly he saw a person sitting at a corner of the room, telling Swedenborg: “Do not eat too much!”. Swedenborg, scared, hurried home. Later that night, the same man appeared in his dreams. The man told Swedenborg that He was the Lord, that He had appointed Swedenborg to reveal the spiritual meaning of the Bible, and that He would guide Swedenborg in what to write. The same night, the spiritual world was opened to Swedenborg.
Read a summary of the paper “Talking back to the spirits: the voices and visions of Emanuel Swedenborg” written by Simon R. Jones and Charles Fernyhough, published in the History of the Human Sciences, Vol. 21, No. 1, 1-31 (2008) here