Skip to content

Commit

Permalink
feat(email): do not require reply to
Browse files Browse the repository at this point in the history
  • Loading branch information
romain-jeannoutot committed Jun 6, 2023
1 parent 2482455 commit b49440a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions email.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var (
ErrFromRequired = errors.New("from is required")
ErrToRequired = errors.New("to is required")
ErrBodyRequired = errors.New("body is required")
ErrReplyToRequired = errors.New("reply to is required")
ErrSubjectRequired = errors.New("subject is required")
)

Expand Down Expand Up @@ -72,12 +71,10 @@ func (e *Email) Validate() error {
return err
}

if e.replyTo == nil {
return ErrReplyToRequired
}

if err := e.replyTo.Validate(); err != nil {
return err
if e.replyTo != nil {
if err := e.replyTo.Validate(); err != nil {
return err
}
}

for _, a := range e.attachments {
Expand Down

0 comments on commit b49440a

Please sign in to comment.