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
2d27a5e9
Commit
2d27a5e9
authored
Mar 23, 2009
by
Richard Mansfield
Browse files
Add unsubscribe link to forum post emails
parent
e724aa6c
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/interaction/forum/lib.php
View file @
2d27a5e9
...
...
@@ -400,6 +400,8 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
$user
->
message
=
(
$post
->
subject
?
$post
->
subject
.
"
\n
"
.
str_repeat
(
'-'
,
strlen
(
$post
->
subject
))
.
"
\n
"
:
''
)
.
trim
(
html2text
(
$post
->
body
));
}
$this
->
unsubscribename
=
$post
->
forumtitle
;
$this
->
unsubscribeurl
=
get_config
(
'wwwroot'
)
.
'interaction/forum/view.php?id='
.
$post
->
forumid
;
}
public
function
get_subject
(
$user
)
{
...
...
htdocs/notification/email/lang/en.utf8/notification.email.php
View file @
2d27a5e9
...
...
@@ -30,6 +30,7 @@ $string['emailsubject'] = '%s';
$string
[
'emailheader'
]
=
'You have been sent a notification from %s. Message follows:'
;
$string
[
'emailfooter'
]
=
'This is an auto generated notification from %s. To update your notification preferences, visit %s'
;
$string
[
'referurl'
]
=
'See %s'
;
$string
[
'unsubscribemessage'
]
=
"To unsubscribe from %s, visit
\n
%s"
;
$string
[
'name'
]
=
'Email'
;
?>
htdocs/notification/email/lib.php
View file @
2d27a5e9
...
...
@@ -57,6 +57,10 @@ class PluginNotificationEmail extends PluginNotification {
}
}
if
(
isset
(
$data
->
unsubscribeurl
)
&&
isset
(
$data
->
unsubscribename
))
{
$messagebody
.
=
"
\n\n
"
.
get_string_from_language
(
$lang
,
'unsubscribemessage'
,
'notification.email'
,
$data
->
unsubscribename
,
$data
->
unsubscribeurl
);
}
$messagebody
.
=
"
\n\n
$separator
"
;
$prefurl
=
get_config
(
'wwwroot'
)
.
'account/activity/preferences/'
;
...
...
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