Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
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
PSDI Army
yii2
Commits
99d82161
Commit
99d82161
authored
Oct 29, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Email message charset setup added.
parent
1d0891f0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
2 deletions
+27
-2
Message.php
extensions/swiftmailer/yii/swiftmailer/Message.php
+18
-2
BaseMessage.php
framework/yii/mail/BaseMessage.php
+1
-0
MessageInterface.php
framework/yii/mail/MessageInterface.php
+6
-0
BaseMailerTest.php
tests/unit/framework/mail/BaseMailerTest.php
+2
-0
No files found.
extensions/swiftmailer/yii/swiftmailer/Message.php
View file @
99d82161
...
...
@@ -42,6 +42,22 @@ class Message extends BaseMessage
/**
* @inheritdoc
*/
public
function
setCharset
(
$charset
)
{
$this
->
getSwiftMessage
()
->
setCharset
(
$charset
);
}
/**
* @return string the character set of this message.
*/
public
function
getCharset
()
{
return
$this
->
getSwiftMessage
()
->
getCharset
();
}
/**
* @inheritdoc
*/
public
function
setFrom
(
$from
)
{
$this
->
getSwiftMessage
()
->
setFrom
(
$from
);
...
...
@@ -232,8 +248,8 @@ class Message extends BaseMessage
{
$embedFile
=
\Swift_EmbeddedFile
::
newInstance
(
$content
);
if
(
!
empty
(
$options
[
'fileName'
]))
{
$embedFile
->
setFilename
(
$options
[
'fileName'
]);
}
$embedFile
->
setFilename
(
$options
[
'fileName'
]);
}
if
(
!
empty
(
$options
[
'contentType'
]))
{
$embedFile
->
setContentType
(
$options
[
'contentType'
]);
}
...
...
framework/yii/mail/BaseMessage.php
View file @
99d82161
...
...
@@ -21,6 +21,7 @@ use Yii;
* @see BaseMailer
*
* @property \yii\mail\BaseMailer $mailer mailer component instance. This property is read-only.
* @property string $charset the character set of this message.
* @property string|array $from sender email address.
* @property string|array $to receiver email address.
* @property string|array $cc copy receiver email address.
...
...
framework/yii/mail/MessageInterface.php
View file @
99d82161
...
...
@@ -16,6 +16,12 @@ namespace yii\mail;
interface
MessageInterface
{
/**
* Set the character set of this message.
* @param string $charset character set name.
*/
public
function
setCharset
(
$charset
);
/**
* Sets message sender.
* @param string|array $from sender email address.
* You may pass an array of addresses if this message is from multiple people.
...
...
tests/unit/framework/mail/BaseMailerTest.php
View file @
99d82161
...
...
@@ -168,6 +168,8 @@ class Message extends BaseMessage
public
$id
;
public
$encoding
;
public
function
setCharset
(
$charset
)
{}
public
function
setFrom
(
$from
)
{}
public
function
setTo
(
$to
)
{}
...
...
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