PHP 클래스 RainLab\User\Models\MailBlocker

A utility model that allows a user to block specific mail views/templates from being sent to their address.
상속: extends Mode\Model
파일 보기 프로젝트 열기: rainlab/user-plugin 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$belongsTo Relations
$table The database table used by the model.

보호된 프로퍼티들

프로퍼티 타입 설명
$guarded Guarded fields
$safeTemplates Templates names that cannot be blocked.

공개 메소드들

메소드 설명
addBlock ( string $template, RainLab\User\Models\User $user ) : boolean Adds a block for a user and a mail view/template code.
blockAll ( RainLab\User\Models\User $user ) : boolean Blocks all mail messages for a user.
checkAllForUser ( Model $user ) : array Returns a list of mail templates blocked by the user.
checkForEmail ( string $template, string $email ) : array Checks if an email address has blocked a given template, returns an array of blocked emails.
filterMessage ( string $template, Illuminate\Mail\Message $message ) : boolean | null Filters a Illuminate\Mail\Message and removes blocked recipients.
isBlockAll ( RainLab\User\Models\User $user ) : boolean Checks if a user is blocking all templates.
removeBlock ( string $template, RainLab\User\Models\User $user ) : boolean Removes a block for a user and a mail view/template code.
setPreferences ( RainLab\User\Models\User $user, array $templates, array $options = [] ) : void Sets mail blocking preferences for a user. Eg:
syncUser ( Model $user ) : mixed Updates mail blockers for a user if they change their email address
unblockAll ( RainLab\User\Models\User $user ) : boolean Removes block on all mail messages for a user.

메소드 상세

addBlock() 공개 정적인 메소드

Adds a block for a user and a mail view/template code.
public static addBlock ( string $template, RainLab\User\Models\User $user ) : boolean
$template string
$user RainLab\User\Models\User
리턴 boolean

blockAll() 공개 정적인 메소드

Blocks all mail messages for a user.
public static blockAll ( RainLab\User\Models\User $user ) : boolean
$user RainLab\User\Models\User
리턴 boolean

checkAllForUser() 공개 정적인 메소드

Returns a list of mail templates blocked by the user.
public static checkAllForUser ( Model $user ) : array
$user Model
리턴 array

checkForEmail() 공개 정적인 메소드

Checks if an email address has blocked a given template, returns an array of blocked emails.
public static checkForEmail ( string $template, string $email ) : array
$template string
$email string
리턴 array

filterMessage() 공개 정적인 메소드

If no recipients remain, false is returned. Returns null if mailing should proceed.
public static filterMessage ( string $template, Illuminate\Mail\Message $message ) : boolean | null
$template string
$message Illuminate\Mail\Message
리턴 boolean | null

isBlockAll() 공개 정적인 메소드

Checks if a user is blocking all templates.
public static isBlockAll ( RainLab\User\Models\User $user ) : boolean
$user RainLab\User\Models\User
리턴 boolean

removeBlock() 공개 정적인 메소드

Removes a block for a user and a mail view/template code.
public static removeBlock ( string $template, RainLab\User\Models\User $user ) : boolean
$template string
$user RainLab\User\Models\User
리턴 boolean

setPreferences() 공개 정적인 메소드

MailBlocker::setPreferences($user, [acme.blog::post.new_reply => 0]) MailBlocker::setPreferences($user, [acme.blog::post.new_reply => 0], [fillable => [acme.blog::post.new_reply]]) MailBlocker::setPreferences($user, [template_alias => 0], [aliases => [template_alias => acme.blog::post.new_reply]]) Supported options: - aliases: Alias definitions, with alias as key and template as value. - fillable: An array of expected templates, undefined templates are ignored. - verify: Only allow mail templates that are registered in the system.
public static setPreferences ( RainLab\User\Models\User $user, array $templates, array $options = [] ) : void
$user RainLab\User\Models\User
$templates array Template name as key and boolean as value. If false, template is blocked.
$options array
리턴 void

syncUser() 공개 정적인 메소드

Updates mail blockers for a user if they change their email address
public static syncUser ( Model $user ) : mixed
$user Model
리턴 mixed

unblockAll() 공개 정적인 메소드

Removes block on all mail messages for a user.
public static unblockAll ( RainLab\User\Models\User $user ) : boolean
$user RainLab\User\Models\User
리턴 boolean

프로퍼티 상세

$belongsTo 공개적으로 프로퍼티

Relations
public $belongsTo

$guarded 보호되어 있는 프로퍼티

Guarded fields
protected $guarded

$safeTemplates 보호되어 있는 정적으로 프로퍼티

Templates names that cannot be blocked.
protected static $safeTemplates

$table 공개적으로 프로퍼티

The database table used by the model.
public $table