Skip to content

Instantly share code, notes, and snippets.

@vadimii
Created April 9, 2014 16:38
Show Gist options
  • Save vadimii/10290053 to your computer and use it in GitHub Desktop.
Save vadimii/10290053 to your computer and use it in GitHub Desktop.
Zabbix Postmark App Sender
#!/usr/bin/python
import sys
import pystmark
API_KEY = 'API-KEY'
SENDER = 'Zabbix <email@example.com>'
def send(recipient, subject, body):
message = pystmark.Message(to=recipient, sender=SENDER,
subject=subject, text=body)
pystmark.send(message, api_key=API_KEY)
if __name__ == '__main__':
"""
recipient = sys.argv[1]
subject = sys.argv[2]
body = sys.argv[3]
"""
if len(sys.argv) == 4:
recipient, subject, body = sys.argv[1:4]
send(recipient, subject, body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment