Skip to content

flask extension for delivering messages. send via the app engine mail or xmpp apis, and/or other third party providers such as sendgrid.

License

Notifications You must be signed in to change notification settings

gregorynicholas/flask-telegram

Repository files navigation

flask-telegram

flask extension for delivering messages.

send using google app-engine mail or xmpp apis, and/or other third party providers such as sendgrid


**build-status:**

master travis-ci build-status: master
develop travis-ci build-status: develop

links:


-----

getting started

install with pip:

$ pip install flask-telegram

-----

features

  • [todo]

-----

example usage

setup from outside the flask app request context:

from flask.ext import telegram

# setup the jinja templates + environment..
from jinja2 import Environment, loaders

jinjaenv = Environment(loader=loaders.DictLoader({
  "subject.html": "{{ var_subject }},"
  "body.html": "<html>{{ var_html_body }}</html>,"
  "body.text": "{{ var_text_body }},"
}))

# setup the template..
messagetemplate = telegram.MessageTemplate(
  sender="[email protected]",
  subject="subject.html",
  body_html="body.html",
  body_text="body.html",
  jinja_env=jinjaenv)

# now let's assume you want to batch message recipients..
recipients = ["[email protected]", "[email protected]", "[email protected]"]

for recipient in recipients:
  context = {
    "var_subject": "telegram'd subject",
    "var_html_body": "telegram'd html body",
    "var_text_body": "telegram'd text body"}

  message = telegram.Message(messagetemplate)
  message.deliver(recipient=recipient, **context)

setup from within the flask app request context:

[todo]

About

flask extension for delivering messages. send via the app engine mail or xmpp apis, and/or other third party providers such as sendgrid.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published