Skip to main content

This Python Package helps you in sending notifications through MoEngage Inform

Project description

moe-inform-client

Table of contents

  • Overview
  • Installation
  • Requirements
  • Usage
  • Troubleshooting and FAQs
  • APIs
  • Contributing
  • License

Overview

This Python Package helps you in sending notifications through MoEngage Inform, the smartest way to design & deliver notifications. Deliver your transactional messages to any channel through one API. Currently Email and SMS channels are supported. For an official overview of Inform Product, please see the Inform Overview or contact us at MoEngage. Happy engaging your users!

Installation

Install from PyPI using pip:

$ pip install moe-inform-client

python3.9 or later is required.

Requirements

  StrEnum~=0.4.9
  urllib3~=1.26.5
  jsonschema~=4.17.3

Note: Install these individually if any issue raises in installation of these requirements like this

$ pip install StrEnum~=0.4.9

Usage

from informclient import InformClient
"""
base_url = "https://sandbox-inform-api-XX.moengage.com"
app_id = "XXXXXXXXXX"
api_secret = "XXXXXXXXXX"
"""
client = InformClient(base_url, app_id, api_secret)
payload = {
    "alert_id": "XXXXXXXXXX",
    "user_id": "XXXXXXXXXX",
    "transaction_id": "XXXXXXXXXX",
    "payloads": 
        {
            "SMS": 
                {
                    "recipient":"+91XXXXXXXXXX",
                    "personalized_attributes": {
                        "attr": "value"
                    }
                },
            "EMAIL":
                {
                    "recipient":"XXXXXXXXXX@example.com",
                    "personalized_attributes": {
                        "attr": "value"
                    }
                }
        }
}
response = client.send_alert(payload)
print(response)

Troubleshooting and FAQs

  • What is the format of base_url?

  • Why do I get sslcertverificationerror while sending an alert?

    • Inform Client is only supported through secured HTTPS connection requests. If the request throws sslcertverificationerror. Run the following commands.
      • For MacOSx
        $ pip install certifi
        $ /Applications/Python\ 3.9/Install\ Certificates.command
        
      • For Windows
        $ pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org informclient
        

APIs

For a full description of request and response payloads and properties, please see the Official Inform API docs.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/moengage/inform-client-python. See CONTRIBUTING.md for more info.

License

This package is available as open source under the terms of the MIT License. MIT LICENSE

Copyright 2023 MOENGAGE

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moe-inform-client-0.0.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moe_inform_client-0.0.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file moe-inform-client-0.0.2.tar.gz.

File metadata

  • Download URL: moe-inform-client-0.0.2.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for moe-inform-client-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b16fe2c47c5b70be57e4ee1234d33c9968322aafc5f669ce6c3f0bc6c377f93e
MD5 9837fb917571517f16769f68624dcef9
BLAKE2b-256 36a543e2b98972a39fc0fe11735b0380c6c82458a70b367683405fb9d0cf43a8

See more details on using hashes here.

File details

Details for the file moe_inform_client-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for moe_inform_client-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eb54d86cae2855b43b3d1cb5b7236954982e2922041f91fb34343bda865ca666
MD5 42d29398da2c5ad146920e7ff112c90b
BLAKE2b-256 89bc6d08b2501d7632589f6fb9ff14662e60e1ba28ccc7defb0fbfaa8437a146

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page