{ "info": { "author": "Matthew Levandowski", "author_email": "levandowski.matthew@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "pymassmailer\r\n =================\r\n \r\n Matthew Levandowski - December 2013\r\n \r\n Overview\r\n --------\r\n \r\n pymassmailer is a generic mass mailer app which can use html jinja2 templates for data.\r\n \r\n It sends an email to the target email with two types\r\n 1) HTML\r\n 2) Plain\r\n \r\n We will try the template with .html for rich html and .txt for plain,\r\n if one isn't found we will only send the correct one.\r\n \r\n Both will rendered with Jinja2\r\n \r\n Py Mass Mailer Can be created by passing the configuration for sending a mail, pkg_name is required so we can find your email templates but depending on your configuration server, username, password may not be required.\r\n \r\n Only server, username, password, port, sender and template_dir can be configured. If you need to change other settings such as logging. Please pass a Config object.\r\n \r\n Config object is specified below:\r\n class Config(object):\r\n \r\n \"\"\"\r\n Py Mass Mailer configuration\r\n \"\"\"\r\n EMAIL_HOST = 'localhost'\r\n EMAIL_USERNAME = ''\r\n EMAIL_PWD = ''\r\n EMAIL_PORT = 25\r\n EMAIL_SENDER = ''\r\n EMAIL_TEMPLATE_DIR = ''\r\n LOGGER_NAME = 'pymassmailer'\r\n LOGGER_LEVEL = logging.NOTSET\r\n DEBUG_LEVEL = 0\r\n SMTP_EHLO_OKAY = 250\r\n SMTP_AUTH_CHALLENGE = 334\r\n SMTP_AUTH_OKAY = 235\r\n \r\n To set just use config = pymassmailer.config(EMAIL_HOST='someserver', ...)\r\n \r\n Installation instructions\r\n -------------------------\r\n \r\n Add the following to the INSTALLED_APPS in the settings.py of your project:\r\n \r\n >>> pip install pymassmailer\r\n \r\n \r\n Example Usage instructions\r\n ---------------------------------------\r\n \r\n I have a sample below that loads an excel file with pandas and mass mails the emails from it:\r\n \r\n Example script:\r\n \r\n ```python\r\n import PyMassMailer\r\n import os\r\n import pandas as pd\r\n \r\n SMTP_SERVER = 'localhost'\r\n TEMPLATE_DIR = os.path.dirname(os.path.abspath(__file__)) + '\\\\templates'\r\n TEMPLATE_NAME = 'message'\r\n FROM_ADDR = \"individualbusiness@somewhere.com\"\r\n SUBJECT = \"Reminder: Waiting for Information.\"\r\n SOURCE_FILE = 'mailmerge-final.xls'\r\n \r\n data = pd.read_excel(SOURCE_FILE, 'Master')\r\n \r\n # Setup mass mailer class\r\n email_sender = PyMassMailer(__name__, server=SMTP_SERVER, default_sender=FROM_ADDR, template_dir=TEMPLATE_DIR)\r\n \r\n # loop through email addresses\r\n for count,row in data.iterrows():\r\n \tprint row\r\n \tTO_ADDR = row['Email']\r\n \tprint 'sending email to: %s' % TO_ADDR\r\n \temail_sender.send_email(TO_ADDR, TEMPLATE_NAME, SUBJECT , name=row['Name'])\r\n ```\r\n \r\n and in templates dir\r\n \r\n layout.html\r\n ```html\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {% block content %}{% endblock %}\r\n \r\n \r\n ```\r\n \r\n \r\n message.html\r\n ```html\r\n {% extends \"layout.html\" %}\r\n \r\n {% block content %}\r\n \r\n

Hello, {{ name }}!

\r\n
\r\n \r\n {% endblock %}\r\n \r\n ```\r\n \r\n message.txt\r\n '''\r\n Hello, {{ name}}\r\n '''\r\n TODO\r\n ====\r\n \r\n #. Add more tests\r\n #. Add option to create config object from CSV file\r\n \r\n Changelog\r\n =========\r\n \r\n Contributors listed as [github.com username] where they are on github \r\n \r\n \r\n [hur1can3]\r\n 1.0 - Released\r\n --------------\r\n #. Use Jinja2 for templates\r\n #. Use Config object in constructor\r\n #. Add file attachment support\r\n \r\n \r\n [hur1can3]\r\n \r\n 0.1 - Unreleased\r\n ----------------\r\n \r\n #. Use mallow mailer\r\n \r\n [Matthew Levandowski]", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hur1can3/pymassmailer", "keywords": "EMAIL SMTP JINJA", "license": "Apache", "maintainer": null, "maintainer_email": null, "name": "pymassmailer", "package_url": "https://pypi.org/project/pymassmailer/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pymassmailer/", "project_urls": { "Homepage": "https://github.com/hur1can3/pymassmailer" }, "release_url": "https://pypi.org/project/pymassmailer/1.1/", "requires_dist": null, "requires_python": null, "summary": "Mass Mailer using mallow mailer and jinja2 templates", "version": "1.1" }, "last_serial": 978419, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "72b4e6534a46ce18158bc47979b164e2", "sha256": "bfb7adad4af89c7a9451fde1ac490e55871c61ef5df3039c25eb665304cd35e2" }, "downloads": -1, "filename": "pymassmailer-1.0-py2.7.egg", "has_sig": false, "md5_digest": "72b4e6534a46ce18158bc47979b164e2", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 8120, "upload_time": "2014-01-23T15:07:26", "url": "https://files.pythonhosted.org/packages/67/52/581bb8f00d8288795564882485c3208fb6c30f4346a5112f774f1230e1e1/pymassmailer-1.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "3de75519b2646006078d48fb5cb82334", "sha256": "72dd43bf6950ace19c5e25bca7f60bae9b8dc9c6f6b27bb083b57eb149a7dad5" }, "downloads": -1, "filename": "pymassmailer-1.0.zip", "has_sig": false, "md5_digest": "3de75519b2646006078d48fb5cb82334", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5702, "upload_time": "2014-01-23T15:07:38", "url": "https://files.pythonhosted.org/packages/a7/71/d063d265b1d7b3ec4530dd0223170ccabb90bc99ed13d41d0a4faaa28fff/pymassmailer-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "51c653411716de49062819c8ea3bfda2", "sha256": "a3b8d7bbbe7fb474ef19f72dc60af5f432f6d784b90b3ba703fe3b9535c0b2ba" }, "downloads": -1, "filename": "pymassmailer-1.1.zip", "has_sig": false, "md5_digest": "51c653411716de49062819c8ea3bfda2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7346, "upload_time": "2014-01-23T15:43:31", "url": "https://files.pythonhosted.org/packages/1e/fa/80eb3cd4752f0560758643e84ebac314f0ad2d652e711421613809c48bf0/pymassmailer-1.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "51c653411716de49062819c8ea3bfda2", "sha256": "a3b8d7bbbe7fb474ef19f72dc60af5f432f6d784b90b3ba703fe3b9535c0b2ba" }, "downloads": -1, "filename": "pymassmailer-1.1.zip", "has_sig": false, "md5_digest": "51c653411716de49062819c8ea3bfda2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7346, "upload_time": "2014-01-23T15:43:31", "url": "https://files.pythonhosted.org/packages/1e/fa/80eb3cd4752f0560758643e84ebac314f0ad2d652e711421613809c48bf0/pymassmailer-1.1.zip" } ] }