Support Forum
Here's the latest of where I stand:
1) Created a new theme
2) Put this in the functions.php, which works(!), except as noted below:
add_filter('sph_admin_email', 'my_admin_email', 10, 2);
function my_admin_email($content, $newpost) {$post_content = spdb_table(SFPOSTS, 'post_id='.$newpost['postid'], 'post_content');
$post_content = sp_filter_email_content($post_content);$content = sp_text('TEST forum post on your site').': '.get_option('blogname'). $eol . $eol;
$content .= sp_text('From') . ': '.$tab . $newpost['postername'].' ['.$newpost['posteremail'].']'.', '.sp_text('Poster IP').': '.$newpost['posterip']. $eol . $eol;
$content .= sp_text('Group'). ':'.$tab . sp_filter_title_display($newpost['groupname']) . $eol;
$content .= sp_text('Forum'). ':'.$tab . sp_filter_title_display($newpost['forumname']) . $eol;
$content .= sp_text('Topic'). ':'.$tab . sp_filter_title_display($newpost['topicname']) . $eol;
$content .= urldecode($newpost['url']) . $eol;
$content .= sp_text('Post') . ':'.$eol . $post_content . $eol.$eol;return $content;
}
3) The above works - however: html coding does not come through (not too worried about this yet). More important, the email that comes through looks like the following - note: line breaks within the post are coming through, but the post information is not coming through with line breaks (I guess the .eol is what that's for, but it's not helping).
TEST forum post on your site: Village Presbyterian ChurchFrom: Admin [admin@villagepca.org], Poster IP: 174.255.57.252Group:Church LifeForum:Prayer RequestsTopic:A test post for John's sakehttp://http://villagepca.mailgun.org/c/ZD0wOTA5YSZoPWUxYTY1ZDRkMzUyZWQyOGNhODAzNjk4YjEwYTI5Njg3Jm09engyJmw9d3d3LnZpbGxhZ2VwY2Eub3JnJTJGY2h1cmNoJTJGZm9ydW0lMkZwcmF5ZXItcmVxdWVzdHMlMkZhLXRlc3QtcG9zdC1mb3Itam9obnMtc2FrZSUyRiUyM3AxOFBvc3QlM0FBJnI9cnhjb3N0YSU0MGdtYWlsLmNvbSZ0PVdvcmRQcmVzcyZ0PXZpbGxhZ2VwY2Eub3Jn test 1
A test 2
A test 3
the code you copied did not include the setting of variable $eol... grab that from the start of the core routine and add it to your routine...
and our emails are not set for html content... caused too many problems with folks who were not allowing html emails - yes, significant number of folks still do that...
Visit Cruise Talk Central and Mr Papa's World
The 'from' is set on forum admin > options >email panel.
I explained to you about the use of html email in post 6 of this thread.
If you now have both showing up then I assume you are concatenating your new content onto the original content being passed to your function. You might want to destroy the content being passed in to your function with a $content = ''; as the first statement.
YELLOW
SWORDFISH
|
add a new filter on the subject... use filter 'sph_email_subject'...
Visit Cruise Talk Central and Mr Papa's World
Thanks - shockingly, I think I figured out how to change the 'reply to' by using sph_email_replyto - I presume that's right? So I changed the reply-to to be the poster - however, that means if the admin posts, he doesn't get copied on the post (because I think his email app will see that he is the "reply-to" and thus thinks he's sending his email and it doesn't go into the in-box).
So how can I add a "bcc" to an email?
This is what I have - in the sp_functions of my theme
add_filter('sph_email_replyto', 'my_admin_replyto', 10, 2);
function my_admin_replyto($replyto, $newpost) {$replyto = $newpost['posteremail'];
return $replyto;
}add_filter('sph_email_subject', 'roy_email_subject', 10, 2);
function roy_email_subject($subject, $newpost) {$subject = $newpost['email_prefix'].sp_filter_title_display($newpost['topicname']);
return $subject;
}
I thought it was working but not anymore - what am I doing wrong?
1 Guest(s)