close
Skip to content

Add optional is_confirmed parameter for adding user email alias - #499

Merged
mattwiller merged 3 commits into
masterfrom
confirm_email_alias_param
Jan 11, 2018
Merged

Add optional is_confirmed parameter for adding user email alias#499
mattwiller merged 3 commits into
masterfrom
confirm_email_alias_param

Conversation

@mattwiller

Copy link
Copy Markdown

Fixes #469

@boxcla

boxcla commented Dec 21, 2017

Copy link
Copy Markdown

Verified that @mattwiller has signed the CLA. Thanks for the pull request!

.add("email", email);
.add("email", email);

if (isConfirmed) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this different from the addEmailAlias method when isConfirmed is false. Also, I can't find any documentation about it in https://developer.box.com/reference#get-all-email-aliases-for-a-user

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is_confirmed parameter allows an admin to add an email alias for a user without needing the user to manually verify the email address. I'll follow up about how we want to document it, but it's definitely something that's in use today.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since is_confirmed defaults to false in the addEmailAlias(String) method, can we just make the second method simple, something like addConfirmedEmailAlias(String) which internally defaults the is_confirmed param as true.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to do that without duplicating logic? I'm looking at the code and it seems like in order to have two simple methods like that I would need to copy the main logic for the method across both.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public EmailAlias addEmailAlias(String email)
public EmailAlias addConfirmedEmailAlias(String email)
private EmailAlias addEmailAlias(String email, boolean isConfirmed)

Both the public methods can call this private method

@mattwiller
mattwiller requested a review from carycheng January 10, 2018 21:38
@mattwiller
mattwiller merged commit b82e7b6 into master Jan 11, 2018
@mattwiller
mattwiller deleted the confirm_email_alias_param branch January 11, 2018 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants