emails

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachments

type Attachments struct {
	ID string `json:"id"`
}

Attachments represents a reference to an attachment

type EmailBody

type EmailBody struct {
	Text string `json:"text"`
	HTML string `json:"html"`
}

EmailBody contains the content of the email

type EmailContainer

type EmailContainer struct {
	Mailbox     *models.Mailbox
	Email       *models.Email
	Attachments []*models.EmailAttachment
}

EmailContainer holds all the data needed to send an email

type EmailsHandler

type EmailsHandler struct {
	// contains filtered or unexported fields
}

func NewEmailsHandler

func NewEmailsHandler(repos *repository.Repositories) *EmailsHandler

func (*EmailsHandler) Reply

func (h *EmailsHandler) Reply() gin.HandlerFunc

reply to an existing email thread

func (*EmailsHandler) Send

func (h *EmailsHandler) Send() gin.HandlerFunc

Send handles the HTTP request to send a new email

func (*EmailsHandler) ValidateReplyRequest

func (h *EmailsHandler) ValidateReplyRequest(ctx context.Context, request *ReplyEmailRequest) *custom_err.MultiErrors

type ReplyEmailRequest

type ReplyEmailRequest struct {
	ReplyTo     string        `json:"replyTo"`
	Body        EmailBody     `json:"body"`
	Attachments []Attachments `json:"attachments"`
	ScheduleFor time.Time     `json:"scheduleFor"`
}

type SendEmailRequest

type SendEmailRequest struct {
	MailboxID    string        `json:"mailboxId"`
	FromAddress  string        `json:"fromAddress"`
	FromName     string        `json:"fromName"`
	ToAddresses  []string      `json:"toAddresses"`
	CCAddresses  []string      `json:"ccAddresses"`
	BCCAddresses []string      `json:"bccAddresses"`
	ReplyTo      string        `json:"replyTo"`
	Subject      string        `json:"subject"`
	Body         EmailBody     `json:"body"`
	Attachments  []Attachments `json:"attachments"`
	ScheduleFor  time.Time     `json:"scheduleFor"`
}

SendEmailRequest represents the API request for sending an email

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL