[Python SDK]
Django
Send password resets, receipts, and notifications from Django views and Celery tasks.
1
Install the Python package
bash
pip install reloop-email2
Send email from Django
send_email.py
1import os2from django.http import JsonResponse3from reloop_email import Reloop4
5reloop = Reloop(api_key=os.environ["RELOOP_API_KEY"])6
7def send_welcome(request):8 result = reloop.mail.send({9 "from": "Acme <onboarding@yourdomain.com>",10 "to": [request.POST["email"]],11 "subject": "Welcome",12 "html": "<strong>Thanks for signing up.</strong>",13 })14
15 if result.email_error:16 return JsonResponse({"error": str(result.email_error)}, status=500)17
18 return JsonResponse({"id": result.response["id"]})3
GitHub, examples, and API reference
4
Need more help?
- Need help? Contact Support.
- Chat with Reloop developers on Discord.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.
Send with Django.
Get an API key and ship transactional email from Django using the official Python SDK.