public static function isValid(MailInterface $mail, $type)
    {
        $validTypes = static::getValidTypes($type);

        return $mail->isEnabled() && \in_array($mail->getType(), $validTypes, true);
    }
public static function isValid(MailInterface $mail, $type)
    {
        $validTypes = static::getValidTypes($type);

        return $mail->isEnabled() && \in_array($mail->getType(), $validTypes, true);
    }
public static function isValid ( MailInterface $ mail , $ type ) { $ validTypes = static :: getValidTypes ( $ type ) ; return $ mail -> isEnabled ( ) && \ in_array ( $ mail -> getType ( ) , $ validTypes , true ) ; }
Check if the mail template is valid.

@param MailInterface $mail The mail template
@param string        $type The mail type defined in MailTypes::TYPE_*

@return bool
Check if the mail template is valid .