Skip to content

Commit

Permalink
Fixed deprecated function call in FormBlock and added some doc info t…
Browse files Browse the repository at this point in the history
…o components/Mail. This fixes luyadev#826
  • Loading branch information
martinpetrasch committed Apr 18, 2016
1 parent 3eb0f9a commit c6ff3c2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LUYA CHANGELOG

**BC BREAKS** See [UPGRADE.md](UPGRADE.md) as we have made some major changes.

- `#826` Fixed deprecated function call in FormBlock.
- `#787` Fixed bug with sort block problem.
- `#822` zaa-checkbox-array renamed variables.
- `#818` Added basic implementation of page version in cms (run `./vendor/bin/luya commands cmsadmin updater/version` once after upgrading to beta6).
Expand Down
27 changes: 27 additions & 0 deletions core/components/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,49 @@ class Mail extends \yii\base\Component
{
private $_mailer = null;

/**
* @var string sender email address
*/
public $from = '[email protected]';

/**
* @var string sender name
*/
public $fromName = '[email protected]';

/**
* @var string email server host address
*/
public $host = 'mail.zephir.ch';

/**
* @var string email server username
*/
public $username = '[email protected]';

/**
* @var string email server password
*/
public $password = null; // insert password

/**
* @var bool disable if you want to use old PHP sendmail
*/
public $isSMTP = true;

/**
* @var string alternate text message if email client doesn't support HTML
*/
public $altBody = 'Please use a HTML compatible E-Mail-Client to read this E-Mail.';

/**
* @var int email server port
*/
public $port = 587;

/**
* @var bool enable debug output mode 'Data and commands'
*/
public $debug = false;

/**
Expand Down
4 changes: 2 additions & 2 deletions modules/cmsadmin/src/blocks/FormBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public function extraVars()
public function sendMail($message, $email, $name)
{
$mail = Yii::$app->mail;
$mail->fromName = $name;
$mail->from = $email;
$mail->compose($this->getVarValue('subjectText', $this->defaultMailSubject), $message);
$mail->address($this->getVarValue('emailAddress'), $name);
$mail->mailer()->From = $email;
$mail->mailer()->FromName = $name;

if (!$mail->send()) {
return 'Error: '.$mail->error();
Expand Down

0 comments on commit c6ff3c2

Please sign in to comment.