2013-10-07 17:35:22 +02:00
|
|
|
import mandrill
|
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
MAIL_CLIENT = None
|
|
|
|
|
|
|
|
def get_mandrill_client():
|
2013-11-06 00:47:59 +01:00
|
|
|
if settings.MANDRILL_API_KEY == '' or not settings.DEPLOYED or settings.ENTERPRISE:
|
2013-10-25 21:19:30 +02:00
|
|
|
return None
|
|
|
|
|
2013-10-07 17:35:22 +02:00
|
|
|
global MAIL_CLIENT
|
2013-10-25 21:19:30 +02:00
|
|
|
if not MAIL_CLIENT:
|
|
|
|
MAIL_CLIENT = mandrill.Mandrill(settings.MANDRILL_API_KEY)
|
|
|
|
|
2013-10-07 17:35:22 +02:00
|
|
|
return MAIL_CLIENT
|
|
|
|
|