def send_templated_email(recipients, template_path, context=None,<EOL>from_email=settings.DEFAULT_FROM_EMAIL,<EOL>fail_silently=False, extra_headers=None):
recipient_pks = [r.pk for r in recipients if isinstance(r, get_user_model())]<EOL>recipient_emails = [e for e in recipients if not isinstance(e, get_user_model())]<EOL>send = _send_task.delay if use_celery else _send<EOL>msg = send(recipient_pks, recipient_emails, template_path, context, from_email,<EOL>fail_silently, extra_headers=extra_headers)<EOL>return msg<EOL>
recipients can be either a list of emails or a list of users,
if it is users the system will change to the language that the
user has set as theyr mother toungue