Comments (2)
This is my view function in case anybody is curious:
def mail_read_tracker(request, encrypted):
try:
if not defaults.TRACK_ENABLE or not defaults.ENABLE_LOGGING:
return
mail_log_id = signing.loads(encrypted)
mail_log = MailLog.objects.get(log_id=mail_log_id)
req = MockRequest(request)
ip_addr = get_ip(req)
user_agent = req.META.get('HTTP_USER_AGENT')
track_log = MailLogTrack.objects.filter(mail_log=mail_log, ip=ip_addr, ua=user_agent)
if not track_log.exists():
lat_lon = request.META.get('HTTP_X_APPENGINE_CITYLATLONG')
lat, lon = lat_lon.split(',') if lat_lon else (None, None)
MailLogTrack.objects.create(
mail_log=mail_log,
ip=ip_addr,
ua=user_agent,
ip_country_code=request.META.get('HTTP_X_APPENGINE_COUNTRY'),
ip_region=request.META.get('HTTP_X_APPENGINE_REGION'),
ip_city=request.META.get('HTTP_X_APPENGINE_CITY'),
ip_latitude=lat,
ip_longitude=lon,
is_read=True,
)
else:
track_log[0].save()
finally:
return HttpResponse(
content=defaults.TRACK_PIXEL[1],
content_type=defaults.TRACK_PIXEL[0],
)
from django-db-mailer.
This would have also made #99 not necessary as well.
from django-db-mailer.
Related Issues (20)
- load_dbmail_base_templates overwrites existing base templates
- Django 2.0 compatibility HOT 2
- mail_read_tracker fails when celery is not installed
- MailLogTrack only updates MailLog with no way to know who is the e-mail reader
- What version of Django should be supported HOT 2
- remove redundant setting HOT 1
- Whatsapp new business API HOT 1
- python 3.7 django 2.1 HOT 2
- args to template data with send_db_subscription
- deserialize for queue HOT 1
- Centos pip install db mailer failing Unicode UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 15845: ordinal not in range(128)
- NullBooleanField is deprecated HOT 1
- Migrations
- RemovedInDjango40Warning
- django-db-mailer init breaks Django 1.11 HOT 2
- dbmail/signals.py:149 HOT 1
- Error: <SimpleLazyObject: <User: xx>> is not JSON serializable HOT 2
- https in trackable url HOT 4
- GeoIP2 in Tracking HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-db-mailer.