Send email via configured provider. Args: to: Recipient email address subject: Email subject body: Email body html: True if body is HTML Returns: True if sent successfully Raises: Exception: I
(self, to: str, subject: str, body: str, html: bool = False)
| 1028 | self.provider = provider_class(config) |
| 1029 | |
| 1030 | def send(self, to: str, subject: str, body: str, html: bool = False) -> bool: |
| 1031 | """ |
| 1032 | Send email via configured provider. |
| 1033 | |
| 1034 | Args: |
| 1035 | to: Recipient email address |
| 1036 | subject: Email subject |
| 1037 | body: Email body |
| 1038 | html: True if body is HTML |
| 1039 | |
| 1040 | Returns: |
| 1041 | True if sent successfully |
| 1042 | |
| 1043 | Raises: |
| 1044 | Exception: If send fails |
| 1045 | """ |
| 1046 | logging.info(f"[EMAIL] Sending email to {to} via {self.config.provider}") |
| 1047 | return self.provider.send(to, subject, body, html) |
| 1048 | |
| 1049 | def test_connection(self) -> bool: |
| 1050 | """ |