Skip to content

Instantly share code, notes, and snippets.

@mkessler
Created November 9, 2017 14:27
Show Gist options
  • Select an option

  • Save mkessler/97f3525b0043bb10e0cd9f910fd42ff9 to your computer and use it in GitHub Desktop.

Select an option

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: "[email protected]"
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