Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Edit PM notification email
Avatar
foxy7
Member
Free Members
sp_UserOfflineSmall Offline
May 6, 2014 - 7:53 pm

Would like to change the PM notification email a bit like this:

----------------------------------------------------------------------------------------------------------

"There is a new private message for you on the forum at: ***INBOX LINK***

From: *USER*
Title: *TITLE*

***WEBSITE LINK - REMOVE***

***ADD***

Regards,

*WEBSITE NAME* (NO LINK)*"

------------------------------------------------------------------------------------------------------------

I assume it has to be done in a way like described in this thread: https://simple-press.com/suppo.....ification/

That is meant for subscriptions though, can you clarify how it should be done for this? Much appreciated!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 6, 2014 - 8:35 pm

similar.. you will have to use filters to change it up...  the filters are:

subject - sph_pm_email_subject

content - sph_pm_email_notification

as drastic a change as you want to make, you will probably just want to rebuild the passed filter value your self using the passed argument containing the pm object...

Avatar
foxy7
Member
Free Members
sp_UserOfflineSmall Offline
May 7, 2014 - 4:17 pm

I am unable to get it working, probably doing something wrong. Could you post the full raw code?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 8, 2014 - 12:59 am

something like this... adjust as needed...

add_filter('sph_pm_email_subject', 'my_pm_mail_subject', 10, 2);
function my_pm_mail_subject($title, $email) {
    $title = 'This is my new title';
    return $title;
}
add_filter('sph_pm_email_notification', 'my_pm_mail_content', 10, 2);
function my_pm_mail_content($msg, $email) {
    $msg = 'This is my email content';
    return $msg;
}

if you need the link to the inbox, you can get it with:

    $url = sp_url('private-messaging/inbox');
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625