getEmail() returning empty object

Hi there, I tried what you said but can you give me a simple example to define getEmail in backend which return email of user, and in frontend I call that method.