code: func extractEmailNotifyValues(build *buildbucketpb.Build, parametersJSON string) ([]EmailNotify, error) {
  	const propertyName = "email_notify"
  	value := build.GetOutput().GetProperties().GetFields()[propertyName]
  	if value == nil {
  		value = build.GetInput().GetProperties().GetFields()[propertyName]
  	}
  	if value != nil {
  		notifiesPB := value.GetListValue().GetValues()
  		ret := make([]EmailNotify, len(notifiesPB))
  		for i, notifyPB := range notifiesPB {
  			notifyFields := notifyPB.GetStructValue().GetFields()
  			ret[i] = EmailNotify{
  				Email:    notifyFields["email"].GetStringValue(),
  				Template: notifyFields["template"].GetStringValue(),
  			}
  		}
  		return ret, nil
  	}
  
  	if parametersJSON == "" {
  		return nil, nil
  	}
  	// json equivalent: {"email_notify": [{"email": "<address>"}, ...]}
  	var output struct {
  		EmailNotify []EmailNotify `json:"email_notify"`
  	}
  
  	if err := json.NewDecoder(strings.NewReader(parametersJSON)).Decode(&output); err != nil {
  		return nil, errors.Annotate(err, "invalid msg.ParametersJson").Err()
  	}
  	return output.EmailNotify, nil
  }
docs: // extractEmailNotifyValues extracts EmailNotify slice from the build.
  // TODO(nodir): remove parametersJSON once clients move to properties.