Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Bug: reset-password enhancements and bug fix #755

Merged
merged 1 commit into from
Aug 6, 2015

Conversation

rhutchison
Copy link
Contributor

Resolved issues:

Enhancements:

  • suppress error messages unless debug mailer option is true.
  • from e-mail address comes from config.
  • added marker messages to each callback line. (Example: [processed/total] Could not send email for x)
  • added status message on-complete to tell how many successful e-mails were sent.

@mleanos
Copy link
Member

mleanos commented Aug 4, 2015

LGTM.. tested, and confirmed it's sending the emails.

Thanks @rhutchison

@mleanos mleanos mentioned this pull request Aug 4, 2015
@lirantal
Copy link
Member

lirantal commented Aug 4, 2015

Cool, thanks guys.

@lirantal lirantal added this to the 0.4.1 milestone Aug 4, 2015
@lirantal lirantal self-assigned this Aug 4, 2015
@mleanos
Copy link
Member

mleanos commented Aug 4, 2015

@lirantal @rhutchison Slight issue with this script. If there aren't any users in the database, this will hang with no exit. It may seem trivial, but if this script is automated or added to a batch it would reek havoc.

You can add this simple fix after the err check at the beginning of the User.find() callback

if (!users.length) {
      console.log();
      console.log(chalk.yellow('No users were found.'));
      process.exit(0);
    }

I have a more elegant solution to the no users found issue in the PR i submitted to your fork for the user-refactor email migration.

@rhutchison
Copy link
Contributor Author

@mleanos please re-test

@mleanos
Copy link
Member

mleanos commented Aug 5, 2015

@rhutchison I'm going to be away from my computer for most of tonight. I'll test it tomorrow morning.

function reportAndExit(processedCount, errorCount) {
var successCount = processedCount - errorCount;

console.log();
Copy link
Member

Choose a reason for hiding this comment

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

Extra?

Copy link
Member

Choose a reason for hiding this comment

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

@ilanbiala I like the extra line written here. It separates any line item messages from the overall processing results.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ilanbiala provides line separation, as @mleanos mentioned. It was intentional

@mleanos
Copy link
Member

mleanos commented Aug 6, 2015

@rhutchison I've tested this and it works great. However, what's the purpose of the alerts()? No alert dialog's popped up for me; is that the intention? If so, I think merely a console log is sufficient.

@rhutchison
Copy link
Contributor Author

@mleanos alert is just a mapped function to chalk.green, chalk.red, or chalk.yellow depending on the result status.

@mleanos
Copy link
Member

mleanos commented Aug 6, 2015

@rhutchison thank you. I obviously, didn't pay enough attention. Jumped the gun, when I saw the alert :)

LGTM.

@lirantal
Copy link
Member

lirantal commented Aug 6, 2015

Great. Thanks @rhutchison for fixing this.

lirantal added a commit that referenced this pull request Aug 6, 2015
Bug: reset-password enhancements and bug fix
@lirantal lirantal merged commit 232883b into meanjs:master Aug 6, 2015
@rhutchison rhutchison deleted the bug-reset-password branch August 23, 2015 04:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants