Browse Source

Email

master
Nick Sergeant 5 years ago
parent
commit
433e8fe921
3 changed files with 7 additions and 4 deletions
  1. +2
    -2
      settings.py
  2. +4
    -1
      snipts/views.py
  3. +1
    -1
      teams/views.py

+ 2
- 2
settings.py View File

@@ -37,7 +37,7 @@ AUTH_PROFILE_MODULE = 'accounts.UserProfile'
AUTHENTICATION_BACKENDS = ('utils.backends.EmailOrUsernameModelBackend',)
BASE_PATH = os.path.dirname(__file__)
DEBUG = True if 'DEBUG' in os.environ else False
DEFAULT_FROM_EMAIL = 'support@snipt.net'
DEFAULT_FROM_EMAIL = os.environ.get('POSTMARK_INBOUND_ADDRESS', 'snipt@localhost')
EMAIL_BACKEND = 'postmark.django_backend.EmailBackend'
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
INTERNAL_IPS = ('127.0.0.1',)
@@ -65,7 +65,7 @@ ROOT_URLCONF = 'urls'
SECRET_KEY = os.environ.get('SECRET_KEY', 'changeme')
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SEND_BROKEN_LINK_EMAILS = False
SERVER_EMAIL = 'support@snipt.net'
SERVER_EMAIL = os.environ.get('POSTMARK_INBOUND_ADDRESS', 'snipt@localhost')
SESSION_COOKIE_AGE = 15801100
SESSION_COOKIE_SECURE = True if 'USE_SSL' in os.environ else False
SITE_ID = 1


+ 4
- 1
snipts/views.py View File

@@ -18,6 +18,9 @@ from snipts.models import Favorite, Snipt, SniptSecureView
from taggit.models import Tag
from teams.models import Team

import os


RESULTS_PER_PAGE = getattr(settings, 'HAYSTACK_SEARCH_RESULTS_PER_PAGE', 20)


@@ -99,7 +102,7 @@ def report_spam(request, snipt_id):
User: https://snipt.net/admin/auth/user/{}/delete/
Reporter: https://snipt.net/{}/
""".format(snipt.id, snipt.user.id, request.user.username),
'support@snipt.net',
os.environ.get('POSTMARK_INBOUND_ADDRESS', 'snipt@localhost'),
['nick@snipt.net'],
fail_silently=False)



+ 1
- 1
teams/views.py View File

@@ -42,7 +42,7 @@ def for_teams_complete(request):
Team: https://snipt.net/{}
Email: {}
""".format(team.slug, team.email),
'support@snipt.net',
os.environ.get('POSTMARK_INBOUND_ADDRESS', 'snipt@localhost'),
['nick@snipt.net'],
fail_silently=False)



Loading…
Cancel
Save