from django.core.mail import EmailMultiAlternatives

from station_ev import settings


class BaseMailService:
    @staticmethod
    def send_main(subject, body, to_emails, html_content=None):
        msg = EmailMultiAlternatives(
            subject,
            body,
            to=to_emails,
            from_email=settings.NO_REPLAY_EMAIL,
        )
        if html_content:
            msg.attach_alternative(html_content, "text/html")
        email_sent = msg.send()
