A blog article titled "Dies Domini 47: A History of Sunday Obligation" points to Pope John Paul II Apostolic Letter Dies Domini (1998) paragraphs 46 to 49, providing:
- a short history of Sunday Obligation expressed in church documents
- when it became mortal sin
- rationale and circumstances
Paragraphs 46-47 below:
Since the Eucharist is the very heart of Sunday, it is clear why, from the earliest centuries, the Pastors of the Church have not ceased to remind the faithful of the need to take part in the liturgical assembly. "Leave everything on the Lord's Day", urges the third century text known as the Didascalia, "and run diligently to your assembly, because it is your praise of God. Otherwise, what excuse will they make to God, those who do not come together on the Lord's Day to hear the word of life and feed on the divine nourishment which lasts forever?".(75) The faithful have generally accepted this call of the Pastors with conviction of soul and, although there have been times and situations when this duty has not been perfectly met, one should never forget the genuine heroism of priests and faithful who have fulfilled this obligation even when faced with danger and the denial of religious freedom, as can be documented from the first centuries of Christianity up to our own time.
In his first Apology addressed to the Emperor Antoninus and the Senate, Saint Justin proudly described the Christian practice of the Sunday assembly, which gathered in one place Christians from both the city and the countryside.(76) When, during the persecution of Diocletian, their assemblies were banned with the greatest severity, many were courageous enough to defy the imperial decree and accepted death rather than miss the Sunday Eucharist. This was the case of the martyrs of Abitina, in Proconsular Africa, who replied to their accusers: "Without fear of any kind we have celebrated the Lord's Supper, because it cannot be missed; that is our law"; "We cannot live without the Lord's Supper". As she confessed her faith, one of the martyrs said: "Yes, I went to the assembly and I celebrated the Lord's Supper with my brothers and sisters, because I am a Christian".(77)
Even if in the earliest times it was not judged necessary to be prescriptive, the Church has not ceased to confirm this obligation of conscience, which rises from the inner need felt so strongly by the Christians of the first centuries. It was only later, faced with the half-heartedness or negligence of some, that the Church had to make explicit the duty to attend Sunday Mass: more often than not, this was done in the form of exhortation, but at times the Church had to resort to specific canonical precepts. This was the case in a number of local Councils from the fourth century onwards (as at the Council of Elvira of 300, which speaks not of an obligation but of penalties after three absences)(78) and most especially from the sixth century onwards (as at the Council of Agde in 506).(79) These decrees of local Councils led to a universal practice, the obligatory character of which was taken as something quite normal.(80)
The Code of Canon Law of 1917 for the first time gathered this tradition into a universal law.(81) The present Code reiterates this, saying that "on Sundays and other holy days of obligation the faithful are bound to attend Mass".(82) This legislation has normally been understood as entailing a grave obligation: this is the teaching of the Catechism of the Catholic Church,(83) and it is easy to understand why if we keep in mind how vital Sunday is for the Christian life.
(75) II, 59, 2-3: ed. F. X. Funk, 1905, pp. 170-171.
(76) Cf. Apologia I, 67, 3-5: PG 6, 430.
(77) Acta SS. Saturnini, Dativi et aliorum plurimorum Martyrum in Africa, 7, 9, 10: PL 8, 707, 709-710.
(78) Cf. Canon 21, Mansi, Conc. II, 9.
(79) Cf. Canon 47, Mansi, Conc. VIII, 332.
(80) Cf. the contrary proposition, condemned by Innocent XI in 1679, concerning the moral obligation to keep the feast-day holy: DS 2152.
(81) Canon 1248: "Festis de praecepto diebus Missa audienda est": Canon 1247, 1: "Dies festi sub praecepto in universa Ecclesia sunt...omnes et singuli dies dominici".
(82) Code of Canon Law, Canon 1247; the Code of Canons of the Eastern Churches, Canon 881, 1, prescribes that "the Christian faithful are bound by the obligation to participate on Sundays and feast days in the Divine Liturgy or, according to the prescriptions or legitimate customs of their own Church sui iuris, in the celebration of the divine praises".
(83) No. 2181: "Those who deliberately fail in this obligation commit a grave sin".
Expansion of footnotes:
(78) Canon 21 from the Council of Elvira c. 306: "If anyone who lives in the city does not attend church services for three Sundays, let that person be expelled for a brief time in order to make the reproach public."
(79) Canon 47 from the Council of Agde (506). Page 130 of A Popular Handbook on the Origin, History, and Structure of Liturgies, Part 2: "Canon XLVII. enjoins that the episcopal benediction should be given at Mass, and forbids anyone to go out of church till it is given."
(80), (81) see @Geremia's answer
Catholic Answers article "Why Is It a Mortal Sin to Miss Mass?" with poignant stories showing how Christians at the time before Constantine valued Mass more than their own physical life, highlighting the why of going to Mass.
Angelus Magazine 1997 article "Attendance and participation at Mass" having subtitle "A comprehensive explanation of the authentic and traditional understanding of "active participation", and why and how it is important for Catholics to actually participate while attending Mass."