How to encourage students to attend and participate in class? I have seen a shrinking trend in the number of students coming to my classes and suspect that it's due to the large number of digital tools that are available to students.

What techniques can I employ to encourage students to attend class and stay engaged through a class or lecture?
Learning tools are substitute goods - don't be afraid if students choose their favourite tools: This is an excellent question, since it raises a common issue with teaching, and it is an issue where some academics (not referring to you) take an irrational and overly defensive view.  Here are a few points that I think are worth bearing in mind in these situations:


The goal of any university course is to give students the best possible assistance to learn the skills you are seeking to impart in the course.  The lectures and other materials available to students are generally "substitute goods" in economic parlance, meaning that use of one tool assists in learning the course content and thus diminishes the demand for the other substitute tools.  Thus, if the digital tools you are referring to are of high quality, they may be very helpful for students to learn the course content, and thereby diminish demand for your lectures.
Students appreciate having a range of teaching tools they can choose from.  When I was a student, the best lecturers I had were the ones that gave us lecture notes, practice problems, and other teaching resources of such clarity and high-quality that attendance at their lectures became virtually unnecessary.  It was a pleasure to be able to teach yourself the material directly from lecture notes, etc., without the assistance of the lecturer.  In some cases this meant that you learned some part of the course so easily that you could skip the lectures and still feel that you had good command of the subject.
If lecture attendance is dwindling due to the provision of useful outside tools, this can be seen as a signal that the quality of those outside tools is relatively high.  The fact that you are offering outside learning tools that the students perceive to be sufficient for their own learning should be seen as a good thing.  Of course, you should want all the learning tools you are providing to be the best quality they can be, so if your lectures seem to be lagging behind in demand, you should certainly do what you can to improve them.  Since you already have good outside resources, the use of a flipped classroom would be one obvious thing you could try.  Another thing to try would be increasing student questions and other interactions that cannot be substituted by digital materials (e.g., recorded lectures).
Unfortunately, some academics take it personally when students don't attend their lectures, and so they try to encourage attendance by removing outside learning tools that compete with their lectures.  (I am not suggesting that you are thinking about doing this, but I want to raise it anyway, since this is something I have seen other lecturers do in university courses.)  This creates a kind of "race to the bottom" where a lecturer tries to increase demand for one set of tools by diminishing substitute tools.  In the worst-case scenario, a lecturer who gives bad lectures ends up removing other material that could have substituted for those bad lectures, and the students end up with no good learning tool for the course.  In my view, this is a petulant and irrational strategy, which represents a failure to appreciate that the goal of the course is student learning, not affirmation of the teacher's ego.  So whatever you do, I would encourage you not to remove the digital tools that seem to be working successfully.