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
+3 -2
View File
@@ -5,6 +5,7 @@ import (
"encoding/json"
"sync/atomic"
"testing"
"text/template"
"time"
"github.com/google/uuid"
@@ -210,8 +211,8 @@ type santaHandler struct {
nice atomic.Int32
}
func (s *santaHandler) Dispatcher(payload types.MessagePayload, _, _ string) (dispatch.DeliveryFunc, error) {
return func(ctx context.Context, msgID uuid.UUID) (retryable bool, err error) {
func (s *santaHandler) Dispatcher(payload types.MessagePayload, _, _ string, _ template.FuncMap) (dispatch.DeliveryFunc, error) {
return func(_ context.Context, _ uuid.UUID) (retryable bool, err error) {
if payload.Labels["nice"] != "true" {
s.naughty.Add(1)
return false, xerrors.New("be nice")