mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-19 14:05:23 +00:00
email from is the sender name
This commit is contained in:
@@ -73,8 +73,8 @@ func validEmail(email string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *Email) Send(ctx context.Context, request *pb.SendRequest, response *pb.SendResponse) error {
|
func (e *Email) Send(ctx context.Context, request *pb.SendRequest, response *pb.SendResponse) error {
|
||||||
if !validEmail(request.From) {
|
if len(request.From) == 0 {
|
||||||
return errors.BadRequest("email.send.validation", "Invalid from address")
|
return errors.BadRequest("email.send.validation", "Missing from name")
|
||||||
}
|
}
|
||||||
if !validEmail(request.To) {
|
if !validEmail(request.To) {
|
||||||
return errors.BadRequest("email.send.validation", "Invalid to address")
|
return errors.BadRequest("email.send.validation", "Invalid to address")
|
||||||
|
|||||||
Reference in New Issue
Block a user