diff options
author | George Goldberg <george@gberg.me> | 2017-03-02 14:12:23 +0000 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-03-02 09:12:23 -0500 |
commit | f513879ffcd34d0afb1ce254e731af1f7eba5f47 (patch) | |
tree | 5acc877bb1c135ac502057a639871240764cf2dd | |
parent | 2e5ebac615bfe720eee9dfab70e966f81c138a27 (diff) | |
download | chat-f513879ffcd34d0afb1ce254e731af1f7eba5f47.tar.gz chat-f513879ffcd34d0afb1ce254e731af1f7eba5f47.tar.bz2 chat-f513879ffcd34d0afb1ce254e731af1f7eba5f47.zip |
PLT-5479: Import Slack team without emails. (#5597)
Use a fake email address for now, and inform the user doing the import
clearly that this has been done.
-rw-r--r-- | app/slackimport.go | 5 | ||||
-rw-r--r-- | i18n/en.json | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/app/slackimport.go b/app/slackimport.go index c3d968907..5512d8c00 100644 --- a/app/slackimport.go +++ b/app/slackimport.go @@ -155,6 +155,11 @@ func SlackAddUsers(teamId string, slackusers []SlackUser, log *bytes.Buffer) map } email := sUser.Profile["email"] + if email == "" { + email = sUser.Username + "@example.com" + log.WriteString(utils.T("api.slackimport.slack_add_users.missing_email_address", map[string]interface{}{"Email": email, "Username": sUser.Username})) + l4g.Warn(utils.T("api.slackimport.slack_add_users.missing_email_address.warn", map[string]interface{}{"Email": email, "Username": sUser.Username})) + } password := model.NewId() diff --git a/i18n/en.json b/i18n/en.json index 472d30d5f..509ba3f56 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1720,6 +1720,14 @@ "translation": "Failed to add user to channel: {{.Username}}\r\n" }, { + "id": "api.slackimport.slack_add_users.missing_email_address", + "translation": "User {{.Username}} does not have an email address in the Slack export. Using {{.Email}} as a placeholder. The user should update their email address once logged in to the system.\r\n" + }, + { + "id": "api.slackimport.slack_add_users.missing_email_address.warn", + "translation": "User {{.Username}} does not have an email address in the Slack export. Using {{.Email}} as a placeholder. The user should update their email address once logged in to the system." + }, + { "id": "api.slackimport.slack_add_channels.import_failed", "translation": "Failed to import: {{.DisplayName}}\r\n" }, |