{"action":"created","comment":{"url":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/comments/33461462","id":33461462,"diff_hunk":"@@ -0,0 +1,187 @@\n+# -*- coding: utf-8 -*-\n+from email.utils import formataddr\n+from functools import partial\n+\n+from django.conf import settings\n+from django.core.exceptions import ValidationError\n+from django.db import models\n+from django.utils.translation import ugettext, ugettext_lazy as _\n+\n+from djangocms_text_ckeditor.fields import HTMLField\n+\n+from aldryn_forms.models import FormPlugin\n+\n+from emailit.api import construct_mail\n+\n+from .helpers import get_theme_template_name, render_text\n+\n+\n+EMAIL_THEMES = getattr(\n+    settings,\n+    \"ALDRYN_FORMS_EMAIL_THEMES\",\n+    [('default', _('default'))]\n+)\n+\n+\n+class EmailNotificationFormPlugin(FormPlugin):","path":"aldryn_forms/contrib/email_notifications/models.py","position":26,"original_position":26,"commit_id":"b4654abc0a07a64b073ad9e336e4b27efe708258","original_commit_id":"b4654abc0a07a64b073ad9e336e4b27efe708258","user":{"login":"jqb","id":163996,"avatar_url":"https://avatars.githubusercontent.com/u/163996?v=3","gravatar_id":"","url":"https://api.github.com/users/jqb","html_url":"https://github.com/jqb","followers_url":"https://api.github.com/users/jqb/followers","following_url":"https://api.github.com/users/jqb/following{/other_user}","gists_url":"https://api.github.com/users/jqb/gists{/gist_id}","starred_url":"https://api.github.com/users/jqb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jqb/subscriptions","organizations_url":"https://api.github.com/users/jqb/orgs","repos_url":"https://api.github.com/users/jqb/repos","events_url":"https://api.github.com/users/jqb/events{/privacy}","received_events_url":"https://api.github.com/users/jqb/received_events","type":"User","site_admin":false},"body":"Why proxy?","created_at":"2015-06-29T13:11:22Z","updated_at":"2015-06-29T13:11:22Z","html_url":"https://github.com/aldryn/aldryn-forms/pull/45#discussion_r33461462","pull_request_url":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/comments/33461462"},"html":{"href":"https://github.com/aldryn/aldryn-forms/pull/45#discussion_r33461462"},"pull_request":{"href":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/45","id":37297077,"html_url":"https://github.com/aldryn/aldryn-forms/pull/45","diff_url":"https://github.com/aldryn/aldryn-forms/pull/45.diff","patch_url":"https://github.com/aldryn/aldryn-forms/pull/45.patch","issue_url":"https://api.github.com/repos/aldryn/aldryn-forms/issues/45","number":45,"state":"open","locked":false,"title":"configured email notifications.","user":{"login":"czpython","id":994951,"avatar_url":"https://avatars.githubusercontent.com/u/994951?v=3","gravatar_id":"","url":"https://api.github.com/users/czpython","html_url":"https://github.com/czpython","followers_url":"https://api.github.com/users/czpython/followers","following_url":"https://api.github.com/users/czpython/following{/other_user}","gists_url":"https://api.github.com/users/czpython/gists{/gist_id}","starred_url":"https://api.github.com/users/czpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czpython/subscriptions","organizations_url":"https://api.github.com/users/czpython/orgs","repos_url":"https://api.github.com/users/czpython/repos","events_url":"https://api.github.com/users/czpython/events{/privacy}","received_events_url":"https://api.github.com/users/czpython/received_events","type":"User","site_admin":false},"body":"Currently aldryn-forms allows admins to specify recipients that will receive an email notification whenever a certain form is submitted, until now this email has been the same for every single form.\r\n\r\nThe aim of this pull request is to allow admins to configure \"email templates\" via the admin ui that will then be rendered when sending these notifications.\r\n\r\n**features:**\r\n\r\n* Allow for text and html versions of email\r\n* Provides a variable logic where user can organize in the text where to put certain elements.\r\n* Maintains backwards compatibility.\r\n* Sends a personalized email *per* recipient.\r\n* Allows for any number of emails to be registered per form.\r\n\r\n**To do**\r\n\r\n- add something like ```CMS_RAW_ID_USERS``` to form recipients list\r\n\r\n","created_at":"2015-06-09T20:39:15Z","updated_at":"2015-06-29T13:11:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff01fe565f430c59ee75b1650d9d8965f74850f8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/45/commits","review_comments_url":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/45/comments","review_comment_url":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aldryn/aldryn-forms/issues/45/comments","statuses_url":"https://api.github.com/repos/aldryn/aldryn-forms/statuses/b4654abc0a07a64b073ad9e336e4b27efe708258","head":{"label":"aldryn:feature/email-templates","ref":"feature/email-templates","sha":"b4654abc0a07a64b073ad9e336e4b27efe708258","user":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"repo":{"id":11426455,"name":"aldryn-forms","full_name":"aldryn/aldryn-forms","owner":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aldryn/aldryn-forms","description":"Flexible HTML forms for your Aldryn and django CMS projects","fork":false,"url":"https://api.github.com/repos/aldryn/aldryn-forms","forks_url":"https://api.github.com/repos/aldryn/aldryn-forms/forks","keys_url":"https://api.github.com/repos/aldryn/aldryn-forms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aldryn/aldryn-forms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aldryn/aldryn-forms/teams","hooks_url":"https://api.github.com/repos/aldryn/aldryn-forms/hooks","issue_events_url":"https://api.github.com/repos/aldryn/aldryn-forms/issues/events{/number}","events_url":"https://api.github.com/repos/aldryn/aldryn-forms/events","assignees_url":"https://api.github.com/repos/aldryn/aldryn-forms/assignees{/user}","branches_url":"https://api.github.com/repos/aldryn/aldryn-forms/branches{/branch}","tags_url":"https://api.github.com/repos/aldryn/aldryn-forms/tags","blobs_url":"https://api.github.com/repos/aldryn/aldryn-forms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aldryn/aldryn-forms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aldryn/aldryn-forms/git/refs{/sha}","trees_url":"https://api.github.com/repos/aldryn/aldryn-forms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aldryn/aldryn-forms/statuses/{sha}","languages_url":"https://api.github.com/repos/aldryn/aldryn-forms/languages","stargazers_url":"https://api.github.com/repos/aldryn/aldryn-forms/stargazers","contributors_url":"https://api.github.com/repos/aldryn/aldryn-forms/contributors","subscribers_url":"https://api.github.com/repos/aldryn/aldryn-forms/subscribers","subscription_url":"https://api.github.com/repos/aldryn/aldryn-forms/subscription","commits_url":"https://api.github.com/repos/aldryn/aldryn-forms/commits{/sha}","git_commits_url":"https://api.github.com/repos/aldryn/aldryn-forms/git/commits{/sha}","comments_url":"https://api.github.com/repos/aldryn/aldryn-forms/comments{/number}","issue_comment_url":"https://api.github.com/repos/aldryn/aldryn-forms/issues/comments{/number}","contents_url":"https://api.github.com/repos/aldryn/aldryn-forms/contents/{+path}","compare_url":"https://api.github.com/repos/aldryn/aldryn-forms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aldryn/aldryn-forms/merges","archive_url":"https://api.github.com/repos/aldryn/aldryn-forms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aldryn/aldryn-forms/downloads","issues_url":"https://api.github.com/repos/aldryn/aldryn-forms/issues{/number}","pulls_url":"https://api.github.com/repos/aldryn/aldryn-forms/pulls{/number}","milestones_url":"https://api.github.com/repos/aldryn/aldryn-forms/milestones{/number}","notifications_url":"https://api.github.com/repos/aldryn/aldryn-forms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aldryn/aldryn-forms/labels{/name}","releases_url":"https://api.github.com/repos/aldryn/aldryn-forms/releases{/id}","created_at":"2013-07-15T15:25:00Z","updated_at":"2015-06-26T11:33:01Z","pushed_at":"2015-06-29T13:08:03Z","git_url":"git://github.com/aldryn/aldryn-forms.git","ssh_url":"git@github.com:aldryn/aldryn-forms.git","clone_url":"https://github.com/aldryn/aldryn-forms.git","svn_url":"https://github.com/aldryn/aldryn-forms","homepage":"http://www.aldryn.com/en/marketplace/aldryn-forms/","size":1199,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":17,"forks":1,"open_issues":17,"watchers":3,"default_branch":"master"}},"base":{"label":"aldryn:master","ref":"master","sha":"a02746e9b16699539dc34c2698c8594912001e89","user":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"repo":{"id":11426455,"name":"aldryn-forms","full_name":"aldryn/aldryn-forms","owner":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aldryn/aldryn-forms","description":"Flexible HTML forms for your Aldryn and django CMS projects","fork":false,"url":"https://api.github.com/repos/aldryn/aldryn-forms","forks_url":"https://api.github.com/repos/aldryn/aldryn-forms/forks","keys_url":"https://api.github.com/repos/aldryn/aldryn-forms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aldryn/aldryn-forms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aldryn/aldryn-forms/teams","hooks_url":"https://api.github.com/repos/aldryn/aldryn-forms/hooks","issue_events_url":"https://api.github.com/repos/aldryn/aldryn-forms/issues/events{/number}","events_url":"https://api.github.com/repos/aldryn/aldryn-forms/events","assignees_url":"https://api.github.com/repos/aldryn/aldryn-forms/assignees{/user}","branches_url":"https://api.github.com/repos/aldryn/aldryn-forms/branches{/branch}","tags_url":"https://api.github.com/repos/aldryn/aldryn-forms/tags","blobs_url":"https://api.github.com/repos/aldryn/aldryn-forms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aldryn/aldryn-forms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aldryn/aldryn-forms/git/refs{/sha}","trees_url":"https://api.github.com/repos/aldryn/aldryn-forms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aldryn/aldryn-forms/statuses/{sha}","languages_url":"https://api.github.com/repos/aldryn/aldryn-forms/languages","stargazers_url":"https://api.github.com/repos/aldryn/aldryn-forms/stargazers","contributors_url":"https://api.github.com/repos/aldryn/aldryn-forms/contributors","subscribers_url":"https://api.github.com/repos/aldryn/aldryn-forms/subscribers","subscription_url":"https://api.github.com/repos/aldryn/aldryn-forms/subscription","commits_url":"https://api.github.com/repos/aldryn/aldryn-forms/commits{/sha}","git_commits_url":"https://api.github.com/repos/aldryn/aldryn-forms/git/commits{/sha}","comments_url":"https://api.github.com/repos/aldryn/aldryn-forms/comments{/number}","issue_comment_url":"https://api.github.com/repos/aldryn/aldryn-forms/issues/comments{/number}","contents_url":"https://api.github.com/repos/aldryn/aldryn-forms/contents/{+path}","compare_url":"https://api.github.com/repos/aldryn/aldryn-forms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aldryn/aldryn-forms/merges","archive_url":"https://api.github.com/repos/aldryn/aldryn-forms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aldryn/aldryn-forms/downloads","issues_url":"https://api.github.com/repos/aldryn/aldryn-forms/issues{/number}","pulls_url":"https://api.github.com/repos/aldryn/aldryn-forms/pulls{/number}","milestones_url":"https://api.github.com/repos/aldryn/aldryn-forms/milestones{/number}","notifications_url":"https://api.github.com/repos/aldryn/aldryn-forms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aldryn/aldryn-forms/labels{/name}","releases_url":"https://api.github.com/repos/aldryn/aldryn-forms/releases{/id}","created_at":"2013-07-15T15:25:00Z","updated_at":"2015-06-26T11:33:01Z","pushed_at":"2015-06-29T13:08:03Z","git_url":"git://github.com/aldryn/aldryn-forms.git","ssh_url":"git@github.com:aldryn/aldryn-forms.git","clone_url":"https://github.com/aldryn/aldryn-forms.git","svn_url":"https://github.com/aldryn/aldryn-forms","homepage":"http://www.aldryn.com/en/marketplace/aldryn-forms/","size":1199,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":17,"forks":1,"open_issues":17,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/45"},"html":{"href":"https://github.com/aldryn/aldryn-forms/pull/45"},"issue":{"href":"https://api.github.com/repos/aldryn/aldryn-forms/issues/45"},"comments":{"href":"https://api.github.com/repos/aldryn/aldryn-forms/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aldryn/aldryn-forms/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/aldryn/aldryn-forms/statuses/b4654abc0a07a64b073ad9e336e4b27efe708258"}}}}