I have an OnlyFans account which for obvious reasons I kept secret from everyone. But somehow someone has leaked its content (perhaps a friend or an ex-partner who wanted to take a revenge on me). He/she sent an anonymous email to my family with a link to my page. My family was shocked, my father almost had a heart attack. I went to the police (I live in the UK) and asked what could be done to investigate and potentially sue the person behind the mail. But they told me that since the link is public no law has been infringed. Is this really the case? Any help would be greatly appreciated!
The Crown Prosecution Service (CPS) website has guidance for prosecuting offences related to social media and electronic communications in England and Wales.
The website also has guidance for prosecuting the offences of stalking and harassment.
The circumstances described in the question don't suggest there has been a crime. For each of the relevant offences, one or more of its necessary elements do not seem to exist.
In terms of whether you could sue the sender (if you could identify them), the police can't advise you about that. You should ask Citizen's Advice or a solicitor.
It's not defamation because the information is true. Perhaps you could persuade a court that the sender 'intentionally' or 'recklessly' caused emotional distress.
Perhaps consult a solicitor - some offer a free introductory half hour of guidance otherwise it may cost a few hundred pounds for an hour of advice. They will ask you want you want to achieve.