Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email improvements #1561

Merged
merged 58 commits into from
Sep 21, 2016
Merged

Email improvements #1561

merged 58 commits into from
Sep 21, 2016

Conversation

jykae
Copy link
Contributor

@jykae jykae commented Sep 12, 2016

Closes #1123
Closes #1514

Proposed changes

  • new fields SMTP Host & Port for Mail settings
  • contact form is enabled when mail is enabled & contact form email is given
  • send email verification after account creation (registration)
  • notify user about unverified email on frontpage, provide resend verification email link.

Other

  • move some files to more appropriate path based on our new guidelines

Testing

  • use SMTP host smtp.mailgun.org and SMTP port 587 for testing with Mailgun account
  • register new account with existing email address to test email verification

@jykae jykae added this to the Sprint 31 milestone Sep 12, 2016
@bajiat
Copy link
Contributor

bajiat commented Sep 13, 2016

@NNN @marla-singer @frenchbread One of you, please volunteer to review by assigning yourself

@marla-singer marla-singer self-assigned this Sep 13, 2016
@marla-singer
Copy link
Contributor

@jykae When I started application at first time and created admin user, I have a message about e-mail verification although the SMTP settings didn't exist.

@marla-singer
Copy link
Contributor

@jykae After creating new user, it redirects to home page and user is already logined. Also user, who doesn't verify e-mail, can go to Catalogue, add new api and do some manipulations with this api. But user don't have permission to add documentation or upload api logo. When he/she is clicking on button, nothing happens. It's just only console error, which can't be seen by typical users. And it looks very strange for them.
I think it's bad scenario. Either after sign up it redirects to home page without logging (that is logical and it is used everywhere) or it should has sAlert as "You don't have permissions for this.Please verify your e-mail"

@jykae
Copy link
Contributor Author

jykae commented Sep 15, 2016

This is what we talked today in daily. I wanted to get initial review how this looks like. In daily I asked about how the user flow should go, as I didn't have clear understanding how we want it to be.

And first user is one special case, that I did not even thought yet, we should allow first admin user to access platform and make settings. Thanks for review!

@marla-singer
Copy link
Contributor

marla-singer commented Sep 15, 2016

The ideas to improve an e-mail verification:

  1. Add some time limit when link is worked. Maybe it shouldbe daily period or something. Notice to user why the link isn't worked.
  2. If user requests a verification second time, the first link must be non-working. Notice to user that the link isn't worked and why.
  3. If user clicks the link a second time, it should be displayed a message that the link is outdated or incorrect. Notice to user that the link isn't worked and why.
  4. When user go to link from e-mail, show an intermediate page with message "Your e-mail is verifyed. It should beredirect to home page". Now it's just clear page

@jykae
Copy link
Contributor Author

jykae commented Sep 19, 2016

@brylie requested changes done, ready for review

const branding = Branding.findOne();

// Check branding exists
if( branding ) {
Copy link
Contributor

@brylie brylie Sep 20, 2016

Choose a reason for hiding this comment

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

We need to check if (branding && branding.siteTitle), since site title is optional.

// Check settings exists
if( settings && settings.mail && settings.mail.fromEmail ) {
// Return fromEmail
return '<'+settings.mail.fromEmail+'>';
Copy link
Contributor

@brylie brylie Sep 20, 2016

Choose a reason for hiding this comment

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

Move these < and > out of this function. Follow the single responsible principle here. In effect this function should only get the email, not get the email and transform it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Each variable, each line of code, each function, each class, each project should Do One Thing.

Curly's Law

@@ -46,7 +46,7 @@ Settings.schema = new SimpleSchema({
if (mailEnabled === true && !mailUsername) {
return 'required';
}
},
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure you are using ESLint while developing. We have an ESLint rule that requires trailing commas now, based on the Airbnb rules.

@@ -60,7 +60,7 @@ Settings.schema = new SimpleSchema({
if (mailEnabled === true && !mailPassword) {
return 'required';
}
},
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure you are using ESLint while developing. We have an ESLint rule that requires trailing commas now, based on the Airbnb rules.

@jykae
Copy link
Contributor Author

jykae commented Sep 20, 2016

@brylie requested trailing commas added automagically :)

@jykae
Copy link
Contributor Author

jykae commented Sep 20, 2016

@brylie Fixed conflict with eslint

@jykae
Copy link
Contributor Author

jykae commented Sep 21, 2016

@brylie Do you agree my lintings and latest fixes?

@brylie brylie merged commit e556b94 into develop Sep 21, 2016
@brylie brylie deleted the feature/email-improvements branch October 3, 2016 10:42
@ilarimikkonen ilarimikkonen added this to In Review in apinf/platform Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants