Skip to content

Add template support for email notifications - #56

Merged
Hutch79 merged 2 commits into
mainfrom
feature/37-Custom-Mail-Template
Jul 13, 2025
Merged

Add template support for email notifications#56
Hutch79 merged 2 commits into
mainfrom
feature/37-Custom-Mail-Template

Conversation

@Hutch79

@Hutch79 Hutch79 commented Jul 13, 2025

Copy link
Copy Markdown
Member

Add template support for email notifications.
If no template is specified, a default one is used.

You can specify a template with the new DNS-BLM__Mail__MailTemplate option like this:

DNS-BLM__Mail__MailTemplate: |-
        <!DOCTYPE html>
                <html lang="en">
                <head>
                <meta charset="UTF-8" />
                <title>DNS-BLM Report</title>
                </head>
                <body style="margin:0; padding:0; background-color:#f4f4f4;">
                <center>
                    <table width="100%" bgcolor="#f4f4f4" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td align="center">
                        <table width="600" cellpadding="0" cellspacing="0" border="0" bgcolor="#ffffff" style="border:1px solid #ddd;">
                            <tr>
                            <td align="center" bgcolor="#004080" style="padding:24px 0 24px 0; color:#ffffff; font-size:24px; font-family:Arial,sans-serif; font-weight:bold;">
                                DNS-BLM Report
                            </td>
                            </tr>
                            <tr>
                            <td style="padding:24px 24px 24px 24px;">
                                <table width="100%" cellpadding="8" cellspacing="0" border="1" style="border-collapse:collapse; border-color:#ddd; font-family:Arial,sans-serif; font-size:14px;">
                                <thead>
                                    <tr bgcolor="#e6f0ff" style="font-weight:bold;">
                                    <th align="left" style="border-color:#ddd;">Domain</th>
                                    <th align="left" style="border-color:#ddd;">Scanner</th>
                                    <th align="left" style="border-color:#ddd;">Details</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {{#each this}}
                                    <tr>
                                        <td style="border-color:#ddd;">{{Domain}}</td>
                                        <td style="border-color:#ddd;">{{ScannerName}}</td>
                                        <td style="border-color:#ddd;">
                                        {{#if ScanResultUrl}}
                                            <a href="{{ScanResultUrl}}" target="_blank" style="color:#004080; text-decoration:underline;">View Report</a>
                                        {{else}}
                                            N/A
                                        {{/if}}
                                        </td>
                                    </tr>
                                    {{/each}}
                                </tbody>
                                </table>
                            </td>
                            </tr>
                            <tr>
                            <td align="center" style="padding:16px 0 16px 0; color:#777; font-size:12px; font-family:Arial,sans-serif; border-top:1px solid #ddd;">
                                Sent by <a href="https://github.com/Hutch79-Dev/DNS-BLM" target="_blank" style="color:#004080; text-decoration:none;">DNS-BLM</a>
                            </td>
                            </tr>
                        </table>
                        </td>
                    </tr>
                    </table>
                </center>
                </body>
                </html>

The templates use Handlebars.

Fix #37

@Hutch79
Hutch79 enabled auto-merge (squash) July 13, 2025 16:16
@Hutch79
Hutch79 disabled auto-merge July 13, 2025 16:37
@Hutch79
Hutch79 enabled auto-merge (squash) July 13, 2025 16:38
@Hutch79 Hutch79 self-assigned this Jul 13, 2025
@Hutch79
Hutch79 disabled auto-merge July 13, 2025 16:41
@Hutch79
Hutch79 merged commit 6a225dc into main Jul 13, 2025
1 check passed
@Hutch79
Hutch79 deleted the feature/37-Custom-Mail-Template branch July 13, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom E-Mail Template

1 participant