Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
134
Issues
134
List
Boards
Labels
Service Desk
Milestones
Merge Requests
27
Merge Requests
27
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Compare Revisions
e1ec640d1a1b85a4e7dd98eaa69a2726fd9cf857...827ae8e92062fdc23342f4113068dcb4660078c7
Source
827ae8e92062fdc23342f4113068dcb4660078c7
Select Git revision
...
Target
e1ec640d1a1b85a4e7dd98eaa69a2726fd9cf857
Select Git revision
Compare
Commits (3)
(chore): loop email iterator if no entities returned
· 0c777244
Mark Harding
authored
10 hours ago
0c777244
(chore): dev code for promotions email
· 7546fd46
Mark Harding
authored
10 hours ago
7546fd46
(chore): email promotions to use markdown and include template key in hash
· 827ae8e9
Mark Harding
authored
10 hours ago
827ae8e9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
Promotion.php
Core/Email/Batches/Promotion.php
+9
-2
Promotion.php
Core/Email/Campaigns/Promotion.php
+4
-4
EmailSubscribersIterator.php
Core/Email/EmailSubscribersIterator.php
+1
-1
No files found.
Core/Email/Batches/Promotion.php
View file @
827ae8e9
...
...
@@ -93,7 +93,13 @@ class Promotion implements EmailBatchInterface
$i
=
0
;
foreach
(
$iterator
as
$user
)
{
++
$i
;
echo
"
\n
[
$i
]:
$user->guid
"
;
// $user = new \Minds\Entities\User('markna');
// $user->bounced = false;
if
(
$user
->
bounced
)
{
echo
"
\n
[
$i
]:
$user->guid
(
$iterator->offset
) bounced"
;
continue
;
}
$campaign
=
new
Campaigns\Promotion
();
...
...
@@ -103,7 +109,8 @@ class Promotion implements EmailBatchInterface
->
setSubject
(
$this
->
subject
)
->
send
();
echo
' (queued)'
;
echo
"
\n
[
$i
]:
$user->guid
(
$iterator->offset
)"
;
// exit;
}
}
}
This diff is collapsed.
Click to expand it.
Core/Email/Campaigns/Promotion.php
View file @
827ae8e9
...
...
@@ -53,7 +53,8 @@ class Promotion extends EmailCampaign
throw
new
\Exception
(
'You must set a templatePath'
);
}
$this
->
template
->
setTemplate
(
'default.tpl'
);
$this
->
template
->
toggleMarkdown
(
true
);
$this
->
template
->
setBody
(
"./Templates/
$this->templateKey
.tpl"
);
$this
->
template
->
set
(
'user'
,
$this
->
user
);
...
...
@@ -65,7 +66,7 @@ class Promotion extends EmailCampaign
$this
->
template
->
set
(
'topic'
,
$this
->
topic
);
//do not reward twice
$validatorHash
=
sha1
(
$this
->
campaign
.
$this
->
topic
.
$this
->
user
->
guid
.
Config
::
_
()
->
get
(
'emails_secret'
));
$validatorHash
=
sha1
(
$this
->
campaign
.
$this
->
t
emplateKey
.
$this
->
t
opic
.
$this
->
user
->
guid
.
Config
::
_
()
->
get
(
'emails_secret'
));
$this
->
template
->
set
(
'validator'
,
$validatorHash
);
$message
=
new
Message
();
...
...
@@ -76,8 +77,7 @@ class Promotion extends EmailCampaign
->
setHtml
(
$this
->
template
);
//send email
$this
->
mailer
->
queue
(
$message
);
exit
;
$this
->
mailer
->
send
(
$message
);
}
}
This diff is collapsed.
Click to expand it.
Core/Email/EmailSubscribersIterator.php
View file @
827ae8e9
...
...
@@ -125,7 +125,7 @@ class EmailSubscribersIterator implements \Iterator
$users
=
$this
->
builder
->
get
([
'guids'
=>
$guids
]);
if
(
!
$users
)
{
$this
->
valid
=
false
;
return
$this
->
getSubscribers
()
;
return
;
}
...
...
This diff is collapsed.
Click to expand it.