Skip to content

Instantly share code, notes, and snippets.

@mwickett
Last active May 25, 2018 13:47
Show Gist options
  • Save mwickett/a6c0b6e48e73a093352bf5dddbbc9cfe to your computer and use it in GitHub Desktop.
Save mwickett/a6c0b6e48e73a093352bf5dddbbc9cfe to your computer and use it in GitHub Desktop.

Revisions

  1. mwickett renamed this gist May 25, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. mwickett revised this gist May 25, 2018. No changes.
  3. mwickett created this gist May 25, 2018.
    18 changes: 18 additions & 0 deletions test-email.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    // 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]}`
    }