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
How do I customize the subscription notification emails?
Avatar
jdevore
United States
Member
Free Members
sp_UserOfflineSmall Offline
Oct 3, 2012 - 8:32 pm

The notification emails are displaying the name of my news site The Link rather than the name of the forum which happens to be called xChange. 

How can I customize notification emails/ subject line / body text?

 

Thank you.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 4, 2012 - 12:05 am

yes, the subscriptions use your site name...  seemed natural... frankly no one has asked for anything different...

but you can use a filter (standard to wp) to change it...  use the filter:  sph_subscriptions_notification

and you can replace the sitename with the forum name if you like...

if you are unsure how to use wp filters, here is a reference:   http://codex.wordpress.org/Fun.....add_filter

come on back if you need more help past that...

Avatar
jdevore
United States
Member
Free Members
sp_UserOfflineSmall Offline
Oct 4, 2012 - 11:39 am

Thanks for your response. 

 

Do I make the replacement in my wp-config.php file?

 

Not sure which line of code to replace the sph_subscriptions_notification with?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 4, 2012 - 11:06 pm

no, as I said, it would go in the spFunctions.php file of your sp theme...  so something like:

add_filter('sph_subscriptions_notification', 'my_subs_title');
function my_subs_title($content) {
    $content = str_replace('blog title', 'forum name', $content);
    return $content;
}

of course, replace 'blog title' with what you want to replace and change 'forum name' to what you want to replace it with...

also, be sure to make your own sp theme:  http://codex.simple-press.com/.....g-a-theme/

Avatar
jdevore
United States
Member
Free Members
sp_UserOfflineSmall Offline
Oct 5, 2012 - 10:56 am

I followed all of the instructions. The only part I was unsure about was modifying the spFunctions.php file. I tried to add the filter into the code. Here is what I did: 

 

<?php

# --------------------------------------------------------------------------------------

#

# Simple:Press Theme custom function file

# Theme : mytheme

# File : custom functions

# Author : Simple:Press

#

# The 'functions' file can be used for custom functions & is loaded with each template

#

# --------------------------------------------------------------------------------------

add_action('init', 'spmytheme_textdomain');

# load the theme textdomain for tranlations

function spmytheme_textdomain() {

sp_theme_localisation('spmytheme');

}

add_filter('sph_subscriptions_notification', 'my_subs_title'); function my_subs_title($content) {

$content = str_replace('The Link', 'xChange Forum', $content);

return $content;

}

if(function_exists('sp_FontResizer')) {

add_action('sph_BeforeDisplayStart', 'spDefault_spShowFontResize');

}

function spmytheme_spShowFontResize() {

$tipMinus = __sp('decrease forum font size');

$tipReset = __sp('reset forum font size');

$tipPlus = __sp('increase font size');

sp_FontResizer('tagClass=spFontSizeControl spRight', $tipMinus, $tipReset, $tipPlus);

sp_InsertBreak('direction-right');

}

?>

 

Here is the error message I received:

Warning: Cannot modify header information - headers already sent by (output started at /problem-with-post-edit-buttonome/cpsirv/public_html/marketing/thelink/wp-content/sp-resources/forum-themes/mytheme/templates/spFunctions.php:40) in /problem-with-post-edit-buttonome/cpsirv/public_html/marketing/thelink/wp-content/plugins/simple-press/sp-startup/site/sp-ahah-handler.php on line 21

Warning: Cannot modify header information - headers already sent by (output started at /problem-with-post-edit-buttonome/cpsirv/public_html/marketing/thelink/wp-content/sp-resources/forum-themes/mytheme/templates/spFunctions.php:40) in /problem-with-post-edit-buttonome/cpsirv/public_html/marketing/thelink/wp-includes/pluggable.php on line 881

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 5, 2012 - 12:39 pm

hmm... just tested it and it works fine...

can you check your code, in the actual file and make sure the single quotes are proper?  might be worth typing over in case copying from here got different encoded quotes...

Avatar
jdevore
United States
Member
Free Members
sp_UserOfflineSmall Offline
Oct 5, 2012 - 3:51 pm

Doesn't seem to be working for me. Odd. I must be doing something wrong. How would I just change the portion that says: Forum Post - 

to CPS Forum Post?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 6, 2012 - 9:25 am

same kind of hook...  just change the two strings in str_replace... first is from, second is to...

which line is 40 in you spFunctions.php file?  might be worth posting the added code again...  when you copied mine, did you do copy the code using the raw code button? or directly from the post?  the former of course is the proper way...

Avatar
jdevore
United States
Member
Free Members
sp_UserOfflineSmall Offline
Oct 8, 2012 - 11:19 am

I copied the raw code. It's not working. So perhaps, I missed something along the way following the theme creation instructions. 

 

Or perhaps, this isn't the correct place to insert the filter. I also don't understand your post above. change the two strings in str_replace ... Are you saying I would just need to insert what I want replaced first and then content I want to replace it with second? Would be nice if I could get this to work. 

Thanks for your help.

spFunctions-code.PNGImage Enlarger

Avatar
jdevore
United States
Member
Free Members
sp_UserOfflineSmall Offline
Oct 8, 2012 - 11:52 am

I just verified that I followed these instructions: http://codex.simple-press.com/.....g-a-theme/ properly. 

Just not working. Not sure why? 

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: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17344
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10117
Posts: 79600