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 new post email notification
Avatar
Mike.s
Member
Free Members
sp_UserOfflineSmall Offline
Jun 23, 2013 - 6:29 pm

Hi

where can i edit the "new post" email notification? just want to add a bit of additional info

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 23, 2013 - 7:03 pm

what do you want to do?  are we talking admin notifications or subscriptions...

either way, you will have to use a wp hook and filter the content... let us know which you were referring to and we can give you the proper hook...

Avatar
Mike.s
Member
Free Members
sp_UserOfflineSmall Offline
Jun 23, 2013 - 7:41 pm

Hi

I am wanting to change the subscription notification

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 23, 2013 - 11:11 pm

then you can hook into the filter:   sph_subscriptions_notification_email

and add more info either before or after...

do you know how to use wp hooks?

Avatar
Mike.s
Member
Free Members
sp_UserOfflineSmall Offline
Jun 24, 2013 - 4:25 am

Hi, no, i would not know how to use wp hooks

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 24, 2013 - 5:22 am

It is pretty simple. Basically this works by allowing you to modify or even replace the message that has been compiled - just before it is sent. The best place to add this code is in the spFunctions.php file of your SP theme (found in the templates folder).

As with your login question - as always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/).

The basic format of the filter hook and function would be like this:

add_filter('sph_subscriptions_notification_email', 'sp_my_custom_email', 1, 3);

function sp_my_custom_email($m, $newpost, $userid) {
    # This is where you add your stuff to the message $m;
    return $m;
}

Here the variable $m holds the current message. You can add your extra bits to $m - start, end or at some definable mid-point. It is then returned at the end of  the function and effectively replaces the original.

If you need additional help with the bit in the middle - your bit! - then ask away. But we would need detail.

andy-signature.png
YELLOW
SWORDFISH
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