def METHOD_NAME(
    self, template: str, lang: str, recipient: str, data: Dict
) -> None:
    if not self.email_template:
        raise Exception('No email template defined.')
    message = self.email_template.get_message(
        template, lang, self.sender_email, recipient, data
    )
    connection_params = {}
    if self.use_ssl or self.use_tls:
        context = ssl.create_default_context()
    if self.use_ssl:
        connection_params.update({'context': context})
    with self.smtp(
        self.host, self.port, **connection_params  # type: ignore
    ) as smtp:
        if self.use_tls:
            smtp.ehlo()
            smtp.starttls(context=context)
            smtp.ehlo()
        if self.username and self.password:
            smtp.login(self.username, self.password)  # type: ignore
        smtp.sendmail(self.sender_email, recipient, message.as_string())
        smtp.quit()