Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
QUIQQER
QUIQQER
Commits
179deb3e
Commit
179deb3e
authored
Jan 14, 2021
by
Henning Leutz
🥋
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
da9756d9
2438056f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
13 deletions
+32
-13
admin/ajax/system/mailTest.php
admin/ajax/system/mailTest.php
+19
-0
lib/QUI/Mail/Mailer.php
lib/QUI/Mail/Mailer.php
+13
-13
No files found.
admin/ajax/system/mailTest.php
View file @
179deb3e
...
...
@@ -92,6 +92,25 @@ QUI::$Ajax->registerFunction(
);
}
// send mail with Mail Template
try
{
$Mailers
=
QUI
::
getMailManager
()
->
getMailer
();
$Mailers
->
setSubject
(
QUI
::
getLocale
()
->
get
(
'quiqqer/quiqqer'
,
'text.mail.subject'
));
$Mailers
->
setBody
(
QUI
::
getLocale
()
->
get
(
'quiqqer/quiqqer'
,
'text.mail.body'
));
$Mailers
->
addRecipient
(
QUI
::
conf
(
'mail'
,
'admin_mail'
));
$Mailers
->
send
();
}
catch
(
\
Exception
$Exception
)
{
QUI\Mail\Log
::
logException
(
$Exception
);
}
QUI
::
getMessagesHandler
()
->
addSuccess
(
QUI
::
getLocale
()
->
get
(
'quiqqer/quiqqer'
,
'message.testmail.success'
)
);
...
...
lib/QUI/Mail/Mailer.php
View file @
179deb3e
...
...
@@ -104,9 +104,9 @@ class Mailer extends QUI\QDOM
/**
* Send the mail
*
* @throws \QUI\Exception
* @throws \QUI\Exception
|\PHPMailer\PHPMailer\Exception
*/
public
function
send
()
public
function
send
()
:
bool
{
$PHPMailer
=
QUI
::
getMailManager
()
->
getPHPMailer
();
$html
=
$this
->
Template
->
getHTML
();
...
...
@@ -252,7 +252,7 @@ class Mailer extends QUI\QDOM
*
* @return array
*/
public
function
toArray
()
public
function
toArray
()
:
array
{
return
[
'subject'
=>
$this
->
getAttribute
(
'subject'
),
...
...
@@ -278,7 +278,7 @@ class Mailer extends QUI\QDOM
*
* @param string $from - mail@domain.net
*/
public
function
setFrom
(
$from
)
public
function
setFrom
(
string
$from
)
{
$this
->
setAttribute
(
'from'
,
$from
);
}
...
...
@@ -288,7 +288,7 @@ class Mailer extends QUI\QDOM
*
* @param string $fromName - Firstname Lastname
*/
public
function
setFromName
(
$fromName
)
public
function
setFromName
(
string
$fromName
)
{
$this
->
setAttribute
(
'fromName'
,
$fromName
);
}
...
...
@@ -298,7 +298,7 @@ class Mailer extends QUI\QDOM
*
* @param string $subject
*/
public
function
setSubject
(
$subject
)
public
function
setSubject
(
string
$subject
)
{
$this
->
setAttribute
(
'subject'
,
$subject
);
}
...
...
@@ -308,7 +308,7 @@ class Mailer extends QUI\QDOM
*
* @param boolean $html - is the mail a html mail or not?
*/
public
function
setHTML
(
$html
)
public
function
setHTML
(
bool
$html
)
{
$this
->
setAttribute
(
'html'
,
(
bool
)
$html
);
}
...
...
@@ -318,7 +318,7 @@ class Mailer extends QUI\QDOM
*
* @param string $html
*/
public
function
setBody
(
$html
)
public
function
setBody
(
string
$html
)
{
$this
->
Template
->
setBody
(
$html
);
}
...
...
@@ -344,7 +344,7 @@ class Mailer extends QUI\QDOM
* @param string $email - E-Mail
* @param string|boolean $name - E-Mail Name
*/
public
function
addRecipient
(
$email
,
$name
=
false
)
public
function
addRecipient
(
string
$email
,
$name
=
false
)
{
$email
=
\
trim
(
$email
);
$email
=
\
explode
(
','
,
$email
);
...
...
@@ -364,7 +364,7 @@ class Mailer extends QUI\QDOM
* @param string $email - E-Mail
* @param string|boolean $name - E-Mail Name
*/
public
function
addReplyTo
(
$email
,
$name
=
false
)
public
function
addReplyTo
(
string
$email
,
$name
=
false
)
{
$email
=
\
trim
(
$email
);
$email
=
\
explode
(
','
,
$email
);
...
...
@@ -384,7 +384,7 @@ class Mailer extends QUI\QDOM
* @param string $email - E-Mail
* @param string|boolean $name - E-Mail Name
*/
public
function
addCC
(
$email
,
$name
=
false
)
public
function
addCC
(
string
$email
,
$name
=
false
)
{
$email
=
\
trim
(
$email
);
$email
=
\
explode
(
','
,
$email
);
...
...
@@ -404,7 +404,7 @@ class Mailer extends QUI\QDOM
* @param string $email - E-Mail
* @param string|boolean $name - E-Mail Name
*/
public
function
addBCC
(
$email
,
$name
=
false
)
public
function
addBCC
(
string
$email
,
$name
=
false
)
{
$email
=
\
trim
(
$email
);
$email
=
\
explode
(
','
,
$email
);
...
...
@@ -425,7 +425,7 @@ class Mailer extends QUI\QDOM
*
* @return boolean
*/
public
function
addAttachment
(
$file
)
public
function
addAttachment
(
string
$file
):
bool
{
if
(
!
\
file_exists
(
$file
))
{
return
false
;
...
...
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