{ "info": { "author": "James Arthur", "author_email": "username: thruflo, domain: gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Pylons", "Intended Audience :: Developers", "License :: Public Domain", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "[pyramid_postmark][] is a package that integrates the [Postmark][] email sending\nservice with a [Pyramid][] web application. For example, to send an email using\na template:\n\n spec = 'mypackage:templates/newsletter.tmpl'\n email = request.render_email('a@b.com', 'b@c.com', 'Subject', spec)\n request.send_email(email)\n\nIt's a very thin layer around the [python-postmark][] library that provides:\n\n* `request.mailer`, a configured `postmark.PMBatchMail` instance\n* `request.send_email` a function to send one or more email messages\n* `request.email_factory` to instantiate an email message\n* `request.render_email` to instantiate an email using a template\n\nThese are integrated by default with the [pyramid_tm][] transaction machinery, so\nemails are only sent if the current request is successful.\n\n# Install\n\nInstall using `pip` or `easy_install`, e.g.:\n\n pip install pyramid_postmark\n\n# Configure\n\nProvide `postmark.api_key` in your application's `.ini` settings:\n\n postmark.api_key = \n\nInclude the package in the configuration portion of your Pyramid app:\n\n config.include('pyramid_postmark')\n\n# Use\n\nGenerate an email using the postmark library directly:\n\n from postmark import PMMail\n email = PMMail(sender='a@b.com', to='b@c.com', subject='Subject', \n html_body='

Boo

', text_body='Boo')\n\nOr use the factory provided:\n\n # E.g.: in a view callable / anywhere where you're handling a `request`.\n email = request.email_factory('a@b.com', 'b@c.com', 'Subject', '

Boo

')\n\nOr use a template:\n\n spec = 'mypackage:templates/mytemplate.tmpl'\n data = {'msg': 'Boo'} # <-- passed as variables to the template\n email = request.render_email('a@b.com', 'b@c.com', 'Subject', spec, data)\n\nThen send the email like this:\n\n request.send_email(email)\n\nSend multiple emails:\n\n request.send_email([email, email])\n\nUse the batch mailer directly:\n\n request.mailer.messages = [email]\n request.mailer.send()\n\nNote that your sender email will need to match your [Postmark sender signature][].\n\nBy default, `request.send_email` sends the email iff the current transaction\nsucceeds. You can override this using the `postmark.should_join_tx` flag in\nyour `.ini` settings:\n\n postmark.should_join_tx = false\n\nOr when calling `request.send_email`:\n\n request.send_email(email, should_join_tx=False)\n\nIf you're feeling optimisic, you can send the email in the background:\n\n request.send_email(email, in_background=True)\n\nNote that background sending works whether you send immediately or wait for the\ncurrent transaction to succeed. i.e.: As and when the email is to be sent, it\nis send in a background thread using the following code:\n\n do_send = thread_cls(target=mailer.send).start if in_background else mailer.send\n\n# Tests\n\nTested on python2.7 only (as [python-postmark][] is not yet Python3 compatible). \nInstall `mock`, `nose` and `coverage` then e.g.:\n\n $ nosetests --with-coverage --with-doctest --cover-package pyramid_postmark pyramid_postmark\n ...\n Name Stmts Miss Cover Missing\n ------------------------------------------------------\n pyramid_postmark 5 0 100% \n pyramid_postmark.hooks 22 0 100% \n ------------------------------------------------------\n TOTAL 27 0 100% \n ----------------------------------------------------------------------\n Ran 3 tests in 0.017s\n \n OK\n\n[postmark]: http://postmarkapp.com\n[Postmark sender signature]: http://developer.postmarkapp.com\n[pyramid]: http://pyramid.readthedocs.org\n[pyramid_postmark]: https://github.com/thruflo/pyramid_postmark\n[pyramid_tm]: http://pyramid_tm.readthedocs.org\n[python-postmark]: https://github.com/themartorana/python-postmark\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/thruflo/pyramid_postmark", "keywords": null, "license": "This is free and unencumbered software released into the public domain.", "maintainer": null, "maintainer_email": null, "name": "pyramid_postmark", "package_url": "https://pypi.org/project/pyramid_postmark/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyramid_postmark/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/thruflo/pyramid_postmark" }, "release_url": "https://pypi.org/project/pyramid_postmark/0.3.2/", "requires_dist": null, "requires_python": null, "summary": "Integrate the Postmark email service with a Pyramid web application.", "version": "0.3.2" }, "last_serial": 909154, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "1ef97bc25c7b90a1c0b502b837841f86", "sha256": "f7e82b918353eaef93851c1f2963970f31a5b00da9a51c07e0e1fb493e54eb30" }, "downloads": -1, "filename": "pyramid_postmark-0.1.tar.gz", "has_sig": false, "md5_digest": "1ef97bc25c7b90a1c0b502b837841f86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5004, "upload_time": "2012-07-22T14:10:15", "url": "https://files.pythonhosted.org/packages/2a/ec/1e3c6a6b2b638c4e487d8c5f0918389f44eb4b3529bc0450c2c13d17b7c3/pyramid_postmark-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "54b71b7106442adf38c2912bf30b8f45", "sha256": "13de00cdea3f841461dee7efa825bf349440d5a132a657b473aac9665edd5692" }, "downloads": -1, "filename": "pyramid_postmark-0.2.tar.gz", "has_sig": false, "md5_digest": "54b71b7106442adf38c2912bf30b8f45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5186, "upload_time": "2012-09-02T16:10:32", "url": "https://files.pythonhosted.org/packages/93/85/df6cffd82bb90f6ec366ec5581a3584bd273ef463554fe94602a4c535820/pyramid_postmark-0.2.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "df71c0dd1f00aa3eff29a5cfae1ecb42", "sha256": "b565d72a966f6569d0b60dc14ab391c8447654d6ff7f07bf801cd72e79ed7552" }, "downloads": -1, "filename": "pyramid_postmark-0.3.1.tar.gz", "has_sig": false, "md5_digest": "df71c0dd1f00aa3eff29a5cfae1ecb42", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6169, "upload_time": "2013-05-05T15:53:47", "url": "https://files.pythonhosted.org/packages/2c/b1/3bd6ad33503cf386c334636087a40f075bc23a54850eba48096d8f30f11c/pyramid_postmark-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "2e413d24a935a1158f15c9d3d20c44fb", "sha256": "2418ec48e1635c4adeffa88e57554adbd8d38b9bcccf88fe893130517ea54f8e" }, "downloads": -1, "filename": "pyramid_postmark-0.3.2.tar.gz", "has_sig": false, "md5_digest": "2e413d24a935a1158f15c9d3d20c44fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6627, "upload_time": "2013-11-01T12:35:49", "url": "https://files.pythonhosted.org/packages/94/4e/3403ccc3eae57f15d4d49f2d83267595b9ad6acc63738852eaa75180b178/pyramid_postmark-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2e413d24a935a1158f15c9d3d20c44fb", "sha256": "2418ec48e1635c4adeffa88e57554adbd8d38b9bcccf88fe893130517ea54f8e" }, "downloads": -1, "filename": "pyramid_postmark-0.3.2.tar.gz", "has_sig": false, "md5_digest": "2e413d24a935a1158f15c9d3d20c44fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6627, "upload_time": "2013-11-01T12:35:49", "url": "https://files.pythonhosted.org/packages/94/4e/3403ccc3eae57f15d4d49f2d83267595b9ad6acc63738852eaa75180b178/pyramid_postmark-0.3.2.tar.gz" } ] }