2013-10-07 17:35:22 +02:00
|
|
|
import mandrill
|
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
MAIL_CLIENT = None
|
|
|
|
|
|
|
|
def get_mandrill_client():
|
2015-08-21 11:24:18 +02:00
|
|
|
if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT or settings.VOYAGER:
|
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
|
|
|
|
|