Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
151d7dd0
Commit
151d7dd0
authored
Aug 18, 2009
by
Richard Mansfield
Browse files
Send forum emails in html and text
parent
17f5328c
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/interaction/forum/lang/en.utf8/interaction.forum.php
View file @
151d7dd0
...
...
@@ -67,6 +67,14 @@ $string['edittitle'] = 'Edit forum';
$string
[
'edittopic'
]
=
'Edit topic'
;
$string
[
'edittopicsuccess'
]
=
'Topic edited successfully'
;
$string
[
'forumname'
]
=
'Forum Name'
;
$string
[
'forumposthtmltemplate'
]
=
"<div style=
\"
padding: 0.5em 0; border-bottom: 1px solid #999;
\"
><strong>%s by %s</strong><br>%s</div>
<div style=
\"
margin: 1em 0;
\"
>%s</div>
<div style=
\"
font-size: smaller; border-top: 1px solid #999;
\"
>
<p>To see and reply to the post online, follow this link:<br><a href=
\"
%s
\"
>%s</a></p>
<p>To unsubscribe from this %s, visit: <a href=
\"
%s
\"
>%s</a></p>
</div>"
;
$string
[
'forumposttemplate'
]
=
"%s by %s
%s
------------------------------------------------------------------------
...
...
htdocs/interaction/forum/lib.php
View file @
151d7dd0
...
...
@@ -484,6 +484,7 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
}
$posttime
=
strftime
(
get_string
(
'strftimedaydatetime'
),
$post
->
ctime
);
$htmlbody
=
$post
->
body
;
$textbody
=
trim
(
html2text
(
$post
->
body
));
$postlink
=
get_config
(
'wwwroot'
)
.
'interaction/forum/topic.php?id='
.
$post
->
topicid
.
'#post'
.
$this
->
postid
;
...
...
@@ -509,6 +510,15 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
$type
,
$unsubscribelink
);
$user
->
htmlmessage
=
get_string_from_language
(
$lang
,
'forumposthtmltemplate'
,
'interaction.forum'
,
$post
->
subject
?
$post
->
subject
:
get_string_from_language
(
$lang
,
're'
,
'interaction.forum'
,
$post
->
topicsubject
),
display_name
(
$post
->
poster
,
$user
),
$posttime
,
$htmlbody
,
$postlink
,
$postlink
,
$type
,
$unsubscribelink
,
$unsubscribelink
);
}
}
...
...
htdocs/notification/email/lib.php
View file @
151d7dd0
...
...
@@ -32,9 +32,14 @@ class PluginNotificationEmail extends PluginNotification {
public
static
function
notify_user
(
$user
,
$data
)
{
$messagehtml
=
null
;
if
(
!
empty
(
$data
->
overridemessagecontents
))
{
$subject
=
$data
->
subject
;
$messagebody
=
$data
->
message
;
if
(
!
empty
(
$user
->
htmlmessage
))
{
$messagehtml
=
$user
->
htmlmessage
;
}
}
else
{
$lang
=
(
empty
(
$user
->
lang
)
||
$user
->
lang
==
'default'
)
?
get_config
(
'lang'
)
:
$user
->
lang
;
...
...
@@ -75,7 +80,7 @@ class PluginNotificationEmail extends PluginNotification {
$userfrom
->
email
=
get_config
(
'noreplyaddress'
);
}
}
email_user
(
$user
,
$userfrom
,
$subject
,
$messagebody
,
nul
l
,
!
empty
(
$data
->
customheaders
)
?
$data
->
customheaders
:
null
);
email_user
(
$user
,
$userfrom
,
$subject
,
$messagebody
,
$messagehtm
l
,
!
empty
(
$data
->
customheaders
)
?
$data
->
customheaders
:
null
);
}
}
...
...
Write
Preview
Supports
Markdown
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