2bdc02a10f
(imported from commit 4a4d1e4a3ba00deb929647f7f35f2982c2b4add6)
29 lines
1 KiB
Python
Executable file
29 lines
1 KiB
Python
Executable file
#!/usr/bin/python
|
|
import sys
|
|
import os
|
|
import optparse
|
|
|
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
|
import api.common
|
|
prod_client = api.common.HumbugAPI(email="feedback@humbughq.com",
|
|
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
verbose=True,
|
|
site="https://humbughq.com")
|
|
staging_client = api.common.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",
|
|
"stream": "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)
|