Using the OnAfterInsert event in sec_form_add_users I am sending an email to the new user.
I did not want to use “application language” because I want administrators to be able to change the content of the message sent (similar to canned messages in sc_tickets). In sc_tickets it uses html in a field. I didn’t like that because I didn’t want the end user to have to type html to create the canned message.
So I used the html editor (tinymce) to created those canned messages … and it worked great.
This is the code that I was using to get that:
//Get the mail message
sc_lookup(rs, "SELECT outbound_message FROM smtp_message WHERE function_name=‘send_mail_to_new_user’ ");
$newuser_msg = {rs[0][0]};
And this to include the message in the email:
$mail_message = sprintf($newuser_msg);
After updating to v8.1.008 (or maybe it was broken in v8.1.007 and I just did not notice) it no longer works. The error message that I get is this:
Fatal error: Call to undefined function SC_Mail_Image() in …sec_form_add_users_apl.php on line 4310
Looking at line 4310 in sec_form_add_users_apl I see the sc_mail_image but have no idea where that function is supposed to be - because it is not a function that I created.
So there’s my problem.
I’m wondering if anyone else has done the same thing - using canned messages in the email message - and if so would you be willing to share your code? I’m new to this and not sure that I did it right in the first place!
I did look at sc_tickets and see they are using a function “GetTemplateEmailstaff” but that function is not in php methods for any of the applications that use it (which has just caused more confusion! Where is that function???)