retrieveEmailUserDetails retrieves required fields: email for email strategy.
(cmd *cobra.Command, input *userInput)
| 517 | |
| 518 | // retrieveEmailUserDetails retrieves required fields: email for email strategy. |
| 519 | func retrieveEmailUserDetails(cmd *cobra.Command, input *userInput) (*management.User, error) { |
| 520 | if err := userEmail.Ask(cmd, &input.email, nil); err != nil { |
| 521 | return nil, err |
| 522 | } |
| 523 | |
| 524 | userInfo := &management.User{ |
| 525 | Email: &input.email, |
| 526 | Connection: &input.connectionName, |
| 527 | } |
| 528 | |
| 529 | // User's name is optional for email connection and takes the email-id as default. |
| 530 | if input.name != "" { |
| 531 | userInfo.Name = &input.name |
| 532 | } |
| 533 | |
| 534 | return userInfo, nil |
| 535 | } |
| 536 | |
| 537 | func registerDetailsInfo(cmd *cobra.Command, input *userInput) { |
| 538 | userConnectionName.RegisterString(cmd, &input.connectionName, "") |