Files
zulip/zerver/lib/mandrill_client.py
Sahil Dua 058587da77 Remove extra new lines at the ends of Zulip authoried files.
Fixes #1627.

[tweaked by tabbott to avoid patching third-party modules, for now]
2016-09-26 21:05:24 -07:00

18 lines
397 B
Python

import mandrill
from django.conf import settings
MAIL_CLIENT = None
from typing import Optional
def get_mandrill_client():
# type: () -> Optional[mandrill.Mandrill]
if settings.MANDRILL_API_KEY is None or settings.DEVELOPMENT:
return None
global MAIL_CLIENT
if not MAIL_CLIENT:
MAIL_CLIENT = mandrill.Mandrill(settings.MANDRILL_API_KEY)
return MAIL_CLIENT