When no public email address is defined in the user's profile this PR uses the user's primary address instead of the first one found. If no primary is defined it (I don't think this could ever happen) it would fall back to the previous behaviour of using the first one.
When no public email address is defined in the user's profile this PR uses the user's primary address instead of the first one found. If no primary is defined it (I don't think this could ever happen) it would fall back to the previous behaviour of using the first one.
Fixes #317