Skip to content

Instantly share code, notes, and snippets.

@erwinagpasa
Last active July 21, 2023 15:13
Show Gist options
  • Save erwinagpasa/5576938a8bc2b8a97e0a196cd9668fe7 to your computer and use it in GitHub Desktop.
Save erwinagpasa/5576938a8bc2b8a97e0a196cd9668fe7 to your computer and use it in GitHub Desktop.
# SendPulse's Python Library: https://github.com/sendpulse/sendpulse-rest-api-python
from pysendpulse import PySendPulse
if __name__ == "__main__":
TOKEN_STORAGE = 'memcached'
SPApiProxy = PySendPulse(REST_API_ID, REST_API_SECRET, TOKEN_STORAGE)
email = {
'subject': 'This is the test task from REST API',
'html': '<p>This is a test task from https://sendpulse.com/api REST API!</p>',
'text': 'This is a test task from https://sendpulse.com/api REST API!',
'from': {'name': 'John Doe', 'email': 'john.doe@example.com'},
'to': [
{'name': 'Jane Roe', 'email': 'jane.roe@example.com'}
]
}
SPApiProxy.smtp_send_mail(email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment