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
55912306
Commit
55912306
authored
Feb 04, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send mail in Bids
parent
cd90b11a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
common/modules/bids/models/Bid.php
common/modules/bids/models/Bid.php
+16
-0
common/modules/bids/views/bid/mail-all.php
common/modules/bids/views/bid/mail-all.php
+17
-0
No files found.
common/modules/bids/models/Bid.php
View file @
55912306
...
...
@@ -4,6 +4,8 @@ namespace common\modules\bids\models;
use
Yii
;
use
\common\models\Settings
;
/**
* This is the model class for table "bids".
*
...
...
@@ -99,6 +101,20 @@ class Bid extends \common\components\ActiveRecordModel
public
function
send
()
{
$email
=
Settings
::
getValue
(
'bids-support-email'
);
$message
=
Yii
::
$app
->
controller
->
view
->
render
(
'@common/modules/bids/views/bid/mail-all'
,
[
'model'
=>
$this
]);
$headers
=
"MIME-Version: 1.0
\r\n
"
.
"Content-Transfer-Encoding: 8bit
\r\n
"
.
"Content-Type: text/html; charset=
\"
UTF-8
\"\r\n
"
.
"X-Mailer: PHP v."
.
phpversion
()
.
"
\r\n
"
.
"From: Заявка с сайта TaskOn <robot@task-on.com>
\r\n
"
;
$subject
=
"Заявка с сайта TaskOn"
;
mail
(
$email
,
$subject
,
$message
,
$headers
);
}
}
common/modules/bids/views/bid/mail-all.php
0 → 100644
View file @
55912306
<?php
use
yii\helpers\Html
;
use
common\modules\bids\models\Bid
;
?>
Имя:
<?=
$model
->
name
?>
<br>
Телефон:
<?=
$model
->
phone
?>
<br>
Email:
<?=
$model
->
email
?>
<br>
Сообщение:
<?=
$model
->
text
?>
<br>
Файл:
<?=
(
$model
->
filename
?
Html
::
a
(
$model
->
filename
,
\Yii
::
$app
->
params
[
'frontUrl'
]
.
Bid
::
FILE_FOLDER
.
$model
->
filename
)
:
''
)
?>
<br>
Дата добавления заявки:
<?=
date
(
'd.m.Y H:i:s'
,
$model
->
created_at
)
?>
<br>
\ No newline at end of file
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