Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
786e64ee
Commit
786e64ee
authored
Feb 11, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.task-on.com:ktask/task-on.com
parents
fe61fd25
04a74632
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
0 deletions
+50
-0
common/components/UnisenderAPI.php
common/components/UnisenderAPI.php
+11
-0
common/modules/triggers/components/conditions/conditions/CheckEmailToUnsubscribed.php
...onents/conditions/conditions/CheckEmailToUnsubscribed.php
+36
-0
common/modules/triggers/components/conditions/config/main.php
...on/modules/triggers/components/conditions/config/main.php
+3
-0
No files found.
common/components/UnisenderAPI.php
View file @
786e64ee
...
...
@@ -115,6 +115,17 @@ class UnisenderAPI {
return
$this
->
statuses
;
}
/**
* @return bool
*/
public
function
isUnsubscribed
(){
if
(
array_key_exists
(
'result'
,
$this
->
statuses
)
&&
array_key_exists
(
'status'
,
$this
->
statuses
[
'result'
]))
{
if
(
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_UNSUBSCRIBED
)
return
true
;
}
return
false
;
}
/**
* @return bool
*/
...
...
common/modules/triggers/components/conditions/conditions/CheckEmailToUnsubscribed.php
0 → 100644
View file @
786e64ee
<?php
namespace
common\modules\triggers\components\conditions\conditions
;
use
common\components\UnisenderAPI
;
use
common\modules\triggers\components\conditions\vendor\ConditionBase
;
use
common\modules\triggers\components\conditions\vendor\ConditionInterface
;
class
CheckEmailToUnsubscribed
extends
ConditionBase
implements
ConditionInterface
{
const
CONDITION_ID
=
4
;
public
$name
=
'Пользователь отписался'
;
/**
* @param null|string $conditionName
* @return $this mixed
*/
public
static
function
init
(
$conditionName
=
__CLASS__
){
return
parent
::
init
(
$conditionName
);
}
/**
* @param $message
* @return bool
*/
public
function
check
(
$message
){
if
(
!
is_null
(
$message
))
{
// Создаем объект унисендера
$sender
=
new
UnisenderAPI
();
// Делаем запрос на получение статуса сообщения
$sender
->
getMessageStatuses
(
$message
->
message_id
);
return
$sender
->
isUnsubscribed
();
}
return
true
;
}
}
\ No newline at end of file
common/modules/triggers/components/conditions/config/main.php
View file @
786e64ee
...
...
@@ -6,6 +6,9 @@ return [
'check-email-to-opening'
=>
[
'class'
=>
'common\modules\triggers\components\conditions\conditions\CheckEmailToDelivered'
,
],
'check-email-to-unsubscribed'
=>
[
'class'
=>
'common\modules\triggers\components\conditions\conditions\CheckEmailToUnsubscribed'
,
],
'check-clicking-on-the-link'
=>
[
'class'
=>
'common\modules\triggers\components\conditions\conditions\CheckClickingOnTheLink'
,
'params'
=>
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment