Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
2a90152f
Commit
2a90152f
authored
Jan 14, 2019
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorganize PHPMailer loading, fix syntax
parent
c9eee17c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
11 deletions
+13
-11
emails.php
qa-include/app/emails.php
+2
-2
qa-base.php
qa-include/qa-base.php
+3
-1
Email.php
qa-src/Notifications/Email.php
+6
-6
Mailer.php
qa-src/Notifications/Mailer.php
+1
-1
Status.php
qa-src/Notifications/Status.php
+1
-1
No files found.
qa-include/app/emails.php
View file @
2a90152f
...
...
@@ -62,9 +62,9 @@ function qa_send_notification($userid, $email, $handle, $subject, $body, $subs,
}
if
(
$userid
)
{
$sender
=
Email
::
C
reateByUserID
(
$userid
,
$email
,
$handle
);
$sender
=
Email
::
c
reateByUserID
(
$userid
,
$email
,
$handle
);
}
else
{
$sender
=
Email
::
C
reateByEmailAddress
(
$email
,
$handle
);
$sender
=
Email
::
c
reateByEmailAddress
(
$email
,
$handle
);
}
return
$sender
->
sendMessage
(
$subject
,
$body
,
$subs
,
$html
);
...
...
qa-include/qa-base.php
View file @
2a90152f
...
...
@@ -176,7 +176,7 @@ function qa_initialize_constants_1()
define
(
'QA_CATEGORY_DEPTH'
,
4
);
// you can't change this number!
if
(
!
defined
(
'QA_BASE_DIR'
))
define
(
'QA_BASE_DIR'
,
dirname
(
dirname
(
__FILE__
))
.
'/'
);
// try ou
t
best if not set in index.php or qa-index.php - won't work with symbolic links
define
(
'QA_BASE_DIR'
,
dirname
(
dirname
(
__FILE__
))
.
'/'
);
// try ou
r
best if not set in index.php or qa-index.php - won't work with symbolic links
define
(
'QA_EXTERNAL_DIR'
,
QA_BASE_DIR
.
'qa-external/'
);
define
(
'QA_INCLUDE_DIR'
,
QA_BASE_DIR
.
'qa-include/'
);
...
...
@@ -207,6 +207,8 @@ function qa_initialize_constants_1()
}
}
require_once
QA_INCLUDE_DIR
.
'vendor/PHPMailer/PHPMailerAutoload.php'
;
// Polyfills
// password_hash compatibility for 5.3-5.4
...
...
qa-src/Notifications/Email.php
View file @
2a90152f
...
...
@@ -22,10 +22,7 @@ namespace Q2A\Notifications;
use
Q2A\Exceptions\FatalErrorException
;
use
Q2A\Notifications\Mailer
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
//required for qa_db_select_with_pending()
require_once
QA_INCLUDE_DIR
.
'app/options.php'
;
//required for qa_opt()
require_once
QA_INCLUDE_DIR
.
'vendor/PHPMailer/PHPMailerAutoload.php'
;
use
PHPMailer
;
class
Email
{
...
...
@@ -36,6 +33,9 @@ class Email
{
$this
->
email
=
$email
;
$this
->
handle
=
$handle
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
//required for qa_db_select_with_pending()
require_once
QA_INCLUDE_DIR
.
'app/options.php'
;
//required for qa_opt()
}
/**
...
...
@@ -46,7 +46,7 @@ class Email
* @return \self
* @throws FatalErrorException
*/
public
static
function
C
reateByUserID
(
$userid
,
$email
=
''
,
$handle
=
''
)
public
static
function
c
reateByUserID
(
$userid
,
$email
=
''
,
$handle
=
''
)
{
if
(
!
(
int
)
$userid
)
{
throw
new
FatalErrorException
(
'User ID not specified in Notifications/Email/CreateByUserID.'
);
...
...
@@ -92,7 +92,7 @@ class Email
* @param type $handle
* @return \self
*/
public
static
function
C
reateByEmailAddress
(
$email
,
$handle
=
''
)
public
static
function
c
reateByEmailAddress
(
$email
,
$handle
=
''
)
{
return
new
self
(
$email
,
$handle
);
}
...
...
qa-src/Notifications/Mailer.php
View file @
2a90152f
...
...
@@ -20,7 +20,7 @@
namespace
Q2A\Notifications
;
require_once
QA_INCLUDE_DIR
.
'vendor/PHPMailer/PHPMailerAutoload.php'
;
use
PHPMailer
;
class
Mailer
extends
PHPMailer
{
...
...
qa-src/Notifications/Status.php
View file @
2a90152f
...
...
@@ -34,7 +34,7 @@ class Status
self
::
$notifications_suspended
+=
(
$suspend
?
1
:
-
1
);
}
public
static
function
I
sSuspended
()
public
static
function
i
sSuspended
()
{
return
self
::
$notifications_suspended
>
0
;
}
...
...
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