Hi @OoElschOo
I hope your surgery went or will go well.
A foreign marriage is legal in Germany if the people getting married fulfilled the legal requirements according to the laws of their home country and the country they were married in. Here you can read the information from the German Foreign Office on this:
https://***.auswaertiges-amt.de/de/service/fragenkatalog-node/04-heirat-ausl-gueltigkeit-in-d-606266?isLocal=false&isPreview=false
You can have a foreign marriage registered but are not obliged to. If you wish to change your name, then contact the Standesamt in your last place of residence in Germany to do so.
Whether the Standesamt will permit this is another question. As far as I know, there is no clear consensus as to whether online marriages in Utah are recognised in Germany or not. There have been court proceedings about such cases but I am not aware of any clear ruling on this matter. Here is a good overview in German from 2022 on the question:
https://***.sangong-recht.de/news/utah-ehe
I wish you all the best with your health.
Best,
Éanna