Okay, I snooped a bit, and I found out why the hasemail() function doesn't work (though not *why* it doesn't work)
This issue is that the contents of the emailreadlist (and emailunreadlist), i.e. the email ids, are floats. type_string(typeof(globals.save_data['emailreadlist'][0])) is "float", while the type of the parameter id in hasemail is an int. So the Array.has() method won't find it.
I don't know why that is, I don't know how the Godot type system works. I don't see you adding, say, 33.0 or something to the list, so I would have assume it's always an int. But I don't know. Maybe it comes from loading a save?
Going to the computer in your apartment and reading the newly received email makes it int, though.
If you change the if expression in hasemail() to
if save_data['emailreadlist'].has(id) or save_data['emailunreadlist'].has(id) or save_data['emailreadlist'].has(float(id)) or save_data['emailunreadlist'].has(float(id)):
(checking for both int and float, just to be on the save side) then it works, but that's a bit ugly. It's a workaround, I guess?