f9f8a6e603
Fixes #482. (imported from commit 1bd6a7fd993d8d5e225e0311c288dbce0c369a40)
32 lines
867 B
Python
Executable file
32 lines
867 B
Python
Executable file
#!/usr/bin/python
|
|
import sys
|
|
import os
|
|
import optparse
|
|
from os import path
|
|
|
|
sys.path.append(path.join(path.dirname(__file__), '..'))
|
|
import humbug
|
|
prod_client = humbug.HumbugAPI(
|
|
email="feedback@humbughq.com",
|
|
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
verbose=True,
|
|
site="https://humbughq.com")
|
|
staging_client = humbug.HumbugAPI(
|
|
email="feedback@humbughq.com",
|
|
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
verbose=True,
|
|
site="https://staging.humbughq.com")
|
|
|
|
def forward_message(message):
|
|
if message["type"] != "personal":
|
|
return
|
|
forwarded_message = {
|
|
"type": "stream",
|
|
"to": "support",
|
|
"subject": "feedback from %s" % message["sender_email"],
|
|
"content": message["content"],
|
|
}
|
|
staging_client.send_message(forwarded_message)
|
|
|
|
prod_client.call_on_each_message(forward_message)
|