Skip to content

Instantly share code, notes, and snippets.

@devintyler
Created July 28, 2016 20:04
Show Gist options
  • Save devintyler/afd307a08c8059f4501d51c7668ca8bd to your computer and use it in GitHub Desktop.
Save devintyler/afd307a08c8059f4501d51c7668ca8bd to your computer and use it in GitHub Desktop.
// Standard Global Variables
// get email from ARGS
// set up global randomCode variable
// checkForUser() -> First Function
// set up filter variable
// `list` user_profile objects with filter
// if that user is found, trigger generateCode() below
// AND store the owner ID (not user_profile id - you need it to reset User Key)
// if user not found, send error message back and return
// generateCode()
// generate random code
// create data object to be stored including at least:
// Owner ID (not user_profile id)
// randomCode
// true/false confirm if you'd like
// maybe username too
// add a new data object to 'password_reset' Class (whichever Class you choose)
// trigger sendEmail() function below
// catch errors
// sendEmail()
// Use SendGrid or Mailgun (or another) to trigger sending an email
// Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment