Add function to Newsletters service to get logged in users email address - #259
Add function to Newsletters service to get logged in users email address#259michaelclapham wants to merge 1 commit into
Conversation
|
| service Newsletters { | ||
| bool requestSignUp(1: string emailAddress, 2:string newsletterIdentityName) | ||
| bool requestSignUp(1: string emailAddress, 2:string newsletterIdentityName), | ||
| string getLoggedInUserEmail() |
There was a problem hiding this comment.
Thrift question: For not signed in and error cases, what should we return from the native apps? Blank string? Null? Some sort of exception / error object? Something else? Does thrift have a concept of nulls/nullable/optional return types, or are all types capable of also returning null?
There was a problem hiding this comment.
This is okay, but not ideal. If you wanted to get a little fancier you could use something like this:
struct EmailResponse {
1: optional string emailAddress
}
service Newsletters {
EmailResponse getLoggedInUserEmail()
}There was a problem hiding this comment.
We use the approach that Alex suggested above for Epics too:
Lines 35 to 37 in 929d4bf
| service Newsletters { | ||
| bool requestSignUp(1: string emailAddress, 2:string newsletterIdentityName) | ||
| bool requestSignUp(1: string emailAddress, 2:string newsletterIdentityName), | ||
| string getLoggedInUserEmail() |
There was a problem hiding this comment.
This is okay, but not ideal. If you wanted to get a little fancier you could use something like this:
struct EmailResponse {
1: optional string emailAddress
}
service Newsletters {
EmailResponse getLoggedInUserEmail()
}
What does this change?
Adds new method to Newsletters service to get currently logged in user email so that newsletter sign up pages can auto-populate the email input textbox on the page.
How has this change been tested?
There are Android https://github.com/guardian/android-news-app/pull/13238 and iOS https://github.com/guardian/ios-live/pull/10072 PRs that provide an implementation of this new function by having created a pre-release version of bridget to test this new function. The implementations work when called manually from elsewhere in the code, but this PR needs to be built upon by the newsletters team to prove out the functionality end to end.
WebX Ticket: #261
AppX Ticket: https://app.asana.com/1/1210045093164357/project/1215309367148854/task/1216357574103304
How can we measure success?
Have we considered potential risks?
Images
Accessibility