Send information about calls and SMS by email


I am not allowed to use my smartphone during work.
Therefore, I am looking for an app that forwards the number of missed calls and content + sender of incoming SMS to an email.

Thanks to the extension "SmtpClient" this also works smoothly, but only as long as the app is active in the foreground and the display is on.

Is there an extension with which I can use the function?

I am currently working with a "Clock" and always repeating notifications to keep the app in the foreground and the display on. However, this drains the battery too quickly.

Thank you for your help

You might use BackgroundTasks extension

unfortunately I have no idea how to add the Background Task extension so that the app registers and forwards SMS and calls in the background.
Is there an example of how the extension is used. That would be helpful. Thanks.