Support Forum

Email module error

29 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

It also means, of course, that you will be helping us test the fix – so thanks. OK…

Both files that need changes are in the HTML Email plugin. First file is:
html-email/sp-html-email-plugin.php

Around line 48 find this line of code:

add_filter('sph_user_new_user_email_subject', 'sp_html_email_new_user_subject', 10, 3);

and change that 3 at the end to 2.

Then down at line 324, change this function:

function sp_html_email_pw_change_body($msg, $key, $pw) {
    include_once(SPHTMLEMAILLIBDIR.'sp-html-email-components.php');
    $msg = sp_html_email_do_pw_change_body($msg, $key, $pw);
    return $msg;
}

To remove the $pw argument on the 1st and 3rd lines (as well as the comma before them of course)

The other file is:
html-email/library/sp-html-email-components.php

in line 101 find:

function sp_html_email_do_pw_change_body($body, $key, $pw) {

and again remove the comma and $pw at the end of the arguments to the function.

Hope that is clear…

ST Stefania
Stefania
Member

Tried, not fixed. It doesn’t save email text and continues to ignore any changet to text.

YS Yellow Swordfish
Yellow Swordfish
Member

Are we still talking about the password reset email?
Are there any errors in the error log (Errors only – the pink ones!)

ST Stefania
Stefania
Member

Yellow Swordfish said
Are we still talking about the password reset email?
Are there any errors in the error log (Errors only – the pink ones!)  

Yes.

Only this

26 maggio 2016 00:20 | spaErrError | 35 | database


file: /web/htdocs/www.mycuco.it/home/wp-content/sp-resources/forum-plugins/keywords/library/sp-keywords-components.php
line: 79
function: spdb_table
error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1

SELECT * FROM wp_sfposts WHERE post_id >

MP Mr Papa
Mr Papa
Member

that is an interesting error but unrelated…  unfortunately, I am on the road without easy access to the codebase to help much…  and Andy is likely gone for the day (in UK)…

Did you ‘use’ his code or type it manually?  if the former, did you use the view raw code button and copy? otherwise you might have gotten some different characters…

YS Yellow Swordfish
Yellow Swordfish
Member

No – there is still an issue remaining @mr-papa – I have missed something. Will dig in this morning

YS Yellow Swordfish
Yellow Swordfish
Member

Somewhere along the line we seem to have accidentally lost 2 lines of code here. I will go back and see if I can find why but at least we can get you back to working properly first.

This time the file is:
/html-email/admin/sp-html-email-admin-pw-change-save.php

Before the call to the function sp_update_option() near the bottom, add these two extra lines of code:

$option['pw-change-subject'] = sp_filter_save_escape(sp_filter_save_nohtml(trim($_POST['pw-change-subject'])));
 $option['pw-change-body'] = sp_filter_text_save(trim($_POST['pw-change-body']));

and hopefully, this time, we HAVE nailed it!

ST Stefania
Stefania
Member

Mr Papa said
that is an interesting error but unrelated…  unfortunately, I am on the road without easy access to the codebase to help much…  and Andy is likely gone for the day (in UK)…

Did you ‘use’ his code or type it manually?  if the former, did you use the view raw code button and copy? otherwise you might have gotten some different characters…  

I wrote manually, using notepad. In file there is $pw also at line 312 and 314, have I to delete also in these lines?

Please note: I can’t change the text in any way, also if I type “hello world” and save.

ST Stefania
Stefania
Member

Yellow Swordfish said
Somewhere along the line we seem to have accidentally lost 2 lines of code here. I will go back and see if I can find why but at least we can get you back to working properly first.

This time the file is:
/html-email/admin/sp-html-email-admin-pw-change-save.php

Before the call to the function sp_update_option() near the bottom, add these two extra lines of code:

<br />
$option['pw-change-subject'] = sp_filter_save_escape(sp_filter_save_nohtml(trim($_POST['pw-change-subject'])));
 $option['pw-change-body'] = sp_filter_text_save(trim($_POST['pw-change-body']));
<br />

and hopefully, this time, we HAVE nailed it!  

Done, but, sorry, no good news: still can’t change any word. As I wrote to Mr Papa, $pw is in lines 312, 314, too. Have to delete?

YS Yellow Swordfish
Yellow Swordfish
Member

Oh dear – I really wasn’t having a good day yesterday was I…

It was the two $pw instances at lines 312 and 314 that I meant to ask you to remove. I pasted the wrong function into the post. But that doesn’t matter as the function I pasted in doesn’t have the $pw so there was nothing to remove. I assume you did not remove anything from the function I stated yesterday but please nopw do remove the $pw from 312 and 314,

I said earlier that the change password email seemed to be working for us but I was mistaken hence this mornings changes. And these are really a separate issue. However, those two extra lines have fixed it in my tests. You did put them just BEFORE the call to sp_update_option() – yes?

ST Stefania
Stefania
Member

All done, but no way. Could you please send me your full plug-in dir? I could try to upload it by ftp….

ST Stefania
Stefania
Member

In sp-html-email-plugin.php

line 49

add_filter('retrieve_password_title',                   'sp_html_email_pw_change_subject');

all other lines have numbers. Have I to add something?

ST Stefania
Stefania
Member

All done. Now it works.

Great support!!

Thank you!!

YS Yellow Swordfish
Yellow Swordfish
Member

Oh.. I think I just get a B- for this one 🙂