Skip to content

Instantly share code, notes, and snippets.

@mkessler
Created November 9, 2017 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkessler/97f3525b0043bb10e0cd9f910fd42ff9 to your computer and use it in GitHub Desktop.
Save mkessler/97f3525b0043bb10e0cd9f910fd42ff9 to your computer and use it in GitHub Desktop.
if store = Store.find_by_email(params['sender'])
puts "Store exists for #{params['sender']}"
message_url = params['message-url'].gsub('https://', '')
RestClient.post "https://api:#{ENV['MAILGUN_API_KEY']}"\
"@#{message_url}",
from: store.email,
to: "ordrhub@in.parseur.com"
head 200
else
#store doesn't exist, don't send to Parseur
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment