Last active
May 25, 2018 13:47
-
-
Save mwickett/a6c0b6e48e73a093352bf5dddbbc9cfe to your computer and use it in GitHub Desktop.
Alfred script that creates a test email using the date and a random string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is meant to be used with Alfred app - https://www.alfredapp.com/ | |
// Alfred drops args in as {query} | |
// Customize your default email address as you wish. | |
function run() { | |
let email = "{query}" | |
if (!email) email = '[email protected]' | |
const date = new Date() | |
.toISOString() | |
.substring(0, 10) | |
.split('-') | |
.join('') | |
const uuid = Math.random() | |
.toString(36) | |
.substring(2, 7) | |
const splitEmail = email.split('@') | |
return `${splitEmail[0]}+test${date}-${uuid}@${splitEmail[1]}` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment