mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 03:05:14 +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 {
|
||||
if !validEmail(request.From) {
|
||||
return errors.BadRequest("email.send.validation", "Invalid from address")
|
||||
if len(request.From) == 0 {
|
||||
return errors.BadRequest("email.send.validation", "Missing from name")
|
||||
}
|
||||
if !validEmail(request.To) {
|
||||
return errors.BadRequest("email.send.validation", "Invalid to address")
|
||||
|
||||
Reference in New Issue
Block a user