(self, subject, recipient, html_content,
                          text_content=None, cc=None,
                          email_from=settings.DEFAULT_FROM_EMAIL,
                          file_attachments=None, bcc=None,
                          smtp_exception_skip_list=None,
                          messaging_event_id=None,
                          domain=None)
Call with send_HTML_email_async.delay(*args, **kwargs)
    - sends emails in the main celery queue
    - if sending fails, retry in 15 min
    - retry a maximum of 10 times
Call with send_HTML_email_async.delay(*args, **kwargs)
    - sends emails in the main celery queue
    - if sending fails, retry in 15 min
    - retry a maximum of 10 times
Call with send_HTML_email_async . delay ( * args ** kwargs ) - sends emails in the main celery queue - if sending fails retry in 15 min - retry a maximum of 10 times
def send_html_email_async(self, subject, recipient, html_content,
                          text_content=None, cc=None,
                          email_from=settings.DEFAULT_FROM_EMAIL,
                          file_attachments=None, bcc=None,
                          smtp_exception_skip_list=None,
                          messaging_event_id=None,
                          domain=None):
    """ Call with send_HTML_email_async.delay(*args, **kwargs)
    - sends emails in the main celery queue
    - if sending fails, retry in 15 min
    - retry a maximum of 10 times
    """
    try:
        send_HTML_email(
            subject,
            recipient,
            html_content,
            text_content=text_content,
            cc=cc,
            email_from=email_from,
            file_attachments=file_attachments,
            bcc=bcc,
            smtp_exception_skip_list=smtp_exception_skip_list,
            messaging_event_id=messaging_event_id,
            domain=domain
        )
    except Exception as e:
        recipient = list(recipient) if not isinstance(recipient, str) else [recipient]
        notify_exception(
            None,
            message="Encountered error while sending email",
            details={
                'subject': subject,
                'recipients': ', '.join(recipient),
                'error': e,
            }
        )
        try:
            self.retry(exc=e)
            if messaging_event_id is not None:
                mark_subevent_gateway_error(messaging_event_id, e, retrying=True)
        except MaxRetriesExceededError:
            if messaging_event_id is not None:
                mark_subevent_gateway_error(messaging_event_id, e, retrying=False)
def send_html_email_async ( self , subject , recipient , html_content , text_content = None , cc = None , email_from = settings . DEFAULT_FROM_EMAIL , file_attachments = None , bcc = None , smtp_exception_skip_list = None , messaging_event_id = None , domain = None ) : try : send_HTML_email ( subject , recipient , html_content , text_content = text_content , cc = cc , email_from = email_from , file_attachments = file_attachments , bcc = bcc , smtp_exception_skip_list = smtp_exception_skip_list , messaging_event_id = messaging_event_id , domain = domain ) except Exception as e : recipient = list ( recipient ) if not isinstance ( recipient , str ) else [ recipient ] notify_exception ( None , message = "Encountered error while sending email" , details = { 'subject' : subject , 'recipients' : ', ' . join ( recipient ) , 'error' : e , } ) try : self . retry ( exc = e ) if messaging_event_id is not None : mark_subevent_gateway_error ( messaging_event_id , e , retrying = True ) except MaxRetriesExceededError : if messaging_event_id is not None : mark_subevent_gateway_error ( messaging_event_id , e , retrying = False )