Support Forum

edit new post email notification

MS Mike.s
Mike.s
Member

Hi

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

5 Answers

New Answer

MP Mr Papa
Mr Papa
Member

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…

MS Mike.s
Mike.s
Member

Hi

I am wanting to change the subscription notification

MP Mr Papa
Mr Papa
Member

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?

YS Yellow Swordfish
Yellow Swordfish
Member

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/codex/themes/theme-basics/creating-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.