• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mindersec / minder / 13912518563

18 Mar 2025 12:19AM UTC coverage: 56.561% (+0.006%) from 56.555%
13912518563

Pull #5518

github

web-flow
Merge 4b09b9980 into a1767e80d
Pull Request #5518: build(deps): bump github.com/containerd/containerd from 1.7.25 to 1.7.27 in /tools

18177 of 32137 relevant lines covered (56.56%)

37.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/internal/email/noop/noop.go
1
// SPDX-FileCopyrightText: Copyright 2024 The Minder Authors
2
// SPDX-License-Identifier: Apache-2.0
3

4
// Package noop provides a noop email utilities for minder
5
package noop
6

7
import (
8
        "encoding/json"
9
        "fmt"
10

11
        "github.com/ThreeDotsLabs/watermill/message"
12
        "github.com/rs/zerolog"
13

14
        "github.com/mindersec/minder/internal/email"
15
        "github.com/mindersec/minder/pkg/eventer/interfaces"
16
)
17

18
type noop struct {
19
}
20

21
// New creates a new noop email service
22
func New() *noop {
×
23
        return &noop{}
×
24
}
×
25

26
// Register implements the Consumer interface.
27
func (_ *noop) Register(reg interfaces.Registrar) {
×
28
        reg.Register(email.TopicQueueInviteEmail, func(msg *message.Message) error {
×
29
                var e email.MailEventPayload
×
30

×
31
                // Get the message context
×
32
                msgCtx := msg.Context()
×
33

×
34
                // Unmarshal the message payload
×
35
                if err := json.Unmarshal(msg.Payload, &e); err != nil {
×
36
                        return fmt.Errorf("error unmarshalling invite email event: %w", err)
×
37
                }
×
38

39
                // Log the email
40
                zerolog.Ctx(msgCtx).Info().
×
41
                        Str("email", e.Address).
×
42
                        Str("subject", e.Subject).
×
43
                        Str("body_text", e.BodyText).
×
44
                        Msg("Sending noop invite email")
×
45

×
46
                return nil
×
47
        })
48
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc