public static function checkForEmail($template, $email)
    {
        if (in_array($template, static::$safeTemplates)) {
            return [];
        }

        if (empty($email)) {
            return [];
        }

        if (!is_array($email)) {
            $email = [$email => null];
        }

        $emails = array_keys($email);

        return static::where(function($q) use ($template) {
                $q->where('template', $template)->orWhere('template', '*');
            })
            ->whereIn('email', $emails)
            ->lists('email');
    }
public static function checkForEmail($template, $email)
    {
        if (in_array($template, static::$safeTemplates)) {
            return [];
        }

        if (empty($email)) {
            return [];
        }

        if (!is_array($email)) {
            $email = [$email => null];
        }

        $emails = array_keys($email);

        return static::where(function($q) use ($template) {
                $q->where('template', $template)->orWhere('template', '*');
            })
            ->whereIn('email', $emails)
            ->lists('email');
    }
public static function checkForEmail ( $ template , $ email ) { if ( in_array ( $ template , static :: $ safeTemplates ) ) { return [ ] ; } if ( empty ( $ email ) ) { return [ ] ; } if ( ! is_array ( $ email ) ) { $ email = [ $ email => null ] ; } $ emails = array_keys ( $ email ) ; return static :: where ( function ( $ q ) use ( $ template ) { $ q -> where ( 'template' , $ template ) -> orWhere ( 'template' , '*' ) ; } ) -> whereIn ( 'email' , $ emails ) -> lists ( 'email' ) ; }
Checks if an email address has blocked a given template,
returns an array of blocked emails.
@param  string $template
@param  string $email
@return array
Checks if an email address has blocked a given template returns an array of blocked emails .