feat(coderd): add company logo when available for email notifications (#14935)

This PR aims to close #14253 

We keep the default behavior using the Coder logo if there's no logo
set.
Otherwise we want to use the logo based on the URL set in appearance.

---------

Co-authored-by: defelmnq <yvincent@coder.com>
This commit is contained in:
Vincent Vielle
2024-10-22 14:06:19 +02:00
committed by GitHub
co-authored by defelmnq
parent c42f487668
commit 297089e944
16 changed files with 289 additions and 52 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ import (
"errors"
"io"
"net/http"
"text/template"
"github.com/google/uuid"
"golang.org/x/xerrors"
@@ -41,7 +42,7 @@ func NewWebhookHandler(cfg codersdk.NotificationsWebhookConfig, log slog.Logger)
return &WebhookHandler{cfg: cfg, log: log, cl: &http.Client{}}
}
func (w *WebhookHandler) Dispatcher(payload types.MessagePayload, titleMarkdown, bodyMarkdown string) (DeliveryFunc, error) {
func (w *WebhookHandler) Dispatcher(payload types.MessagePayload, titleMarkdown, bodyMarkdown string, _ template.FuncMap) (DeliveryFunc, error) {
if w.cfg.Endpoint.String() == "" {
return nil, xerrors.New("webhook endpoint not defined")
}