// UnmarshalYAML implements the yaml.Unmarshaler interface.
UnmarshalYAML implements the yaml.Unmarshaler interface.
// UnmarshalYAML implements the yaml . Unmarshaler interface .
func (c *EmailConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
	*c = DefaultEmailConfig
	type plain EmailConfig
	if err := unmarshal((*plain)(c)); err != nil {
		return err
	}
	if c.To == "" {
		return fmt.Errorf("missing to address in email config")
	}
	normalizedHeaders := map[string]string{}
	for h, v := range c.Headers {
		normalized := strings.Title(h)
		if _, ok := normalizedHeaders[normalized]; ok {
			return fmt.Errorf("duplicate header %q in email config", normalized)
		}
		normalizedHeaders[normalized] = v
	}
	c.Headers = normalizedHeaders
	return checkOverflow(c.XXX, "email config")
}
func ( c * EmailConfig ) UnmarshalYAML ( unmarshal func ( interface { } ) error ) error { * c = DefaultEmailConfig type plain EmailConfig if err := unmarshal ( ( * plain ) ( c ) ) ; err != nil { return err } if c . To == " " { return fmt . Errorf ( " " ) } normalizedHeaders := map [ string ] string { } for h , v := range c . Headers { normalized := strings . Title ( h ) if _ , ok := normalizedHeaders [ normalized ] ; ok { return fmt . Errorf ( " " , normalized ) } normalizedHeaders [ normalized ] = v } c . Headers = normalizedHeaders return checkOverflow ( c . XXX , " " ) }
UnmarshalYAML implements the yaml.Unmarshaler interface.
UnmarshalYAML implements the yaml . Unmarshaler interface .
// Header names are case-insensitive, check for collisions.