Add an option to email on every build or only on failures
| | |
| | | email: |
| | | # Enable email notifications on build failures |
| | | enabled: false |
| | | # Send email every time the script is run or only on failures |
| | | email_everytime: true |
| | | # Recipient email address |
| | | to: "" |
| | | # Sender email address |
| | |
| | | """Email notification settings.""" |
| | | |
| | | enabled: bool = Field(default=False, description="Enable email notifications") |
| | | email_everytime: bool = Field(default=False, description="Send email every time the script is run") |
| | | to: str = Field(default="", description="Recipient email address") |
| | | from_addr: str = Field(default="", alias="from", description="Sender email address") |
| | | smtp_host: str = Field(default="localhost", description="SMTP server host") |
| | |
| | | |
| | | async def send(self, summary: BuildSummary, config: Config) -> bool: |
| | | """Send email notification.""" |
| | | if not self.config.enabled: |
| | | if not self.config.enabled and (self.config.email_everytime or summary.failed == 0): |
| | | return True |
| | | |
| | | if not self.config.to: |