Help with HTML code

arnabnaha wrote on Thursday, June 18, 2015:

Hello…

I am using the following html code for my automatic notification Emails.

<html>
<head><title>Doctor Appointment Reminder</title></head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#F9F9F9" link="#006699" vlink="#006699" style="overflow-y:scroll;">

This is to remind you of the following appointment at Naha Health Clinic to see <B>***PROVIDER***</B>: <BR>
<BR>
Appointment for : <B>***NAME***</B><BR>
Time, Day and Date : <B>***STARTTIME***</B> on <B>***DATE***</B><BR>
Address of Clinic : <B>B1/102, Panchsheel Housing Complex, M.B. Road, Birati, Kolkata - 700051</B><BR>
<BR>
If you are unable to keep this appointment, please call our office at 03325396068.<BR>
<BR>
For <B>NEW PATIENTS</B>,please bring the following documents along with you:-<BR>
<BR>
1. Your ID card (Passport, Driving License, Voter ID Card, Aadhaar Card, etc)<BR>
<BR>
2. Your Address proof (Passport, Driving License, Voter ID Card, Ration Card, Aadhaar Card, etc)<BR>
<BR>
3.All your previous medical records, test reports and prescription (if any)<BR>
<BR>
<BR>
For <B>EXISTING PATIENTS/ESTABLISHED PATIENTS</B>, please bring the medical record file we supplied you on your first visit with the patient ID.<BR>
<BR>
<BR>
We look forward to seeing you.<BR>
<BR>
Thank you.<BR>
<BR>
Naha Health Clinic Team<BR>
for ***PROVIDER***.<BR>
<BR>
<BR>
<BR>
<HR>
<BR>
<small>Please let us know if you prefer <B>not</B> to receive the email reminders about your future appointments.</small>
</body>
</html>

This works absolutely fine and emails are send nicely. I want to add a header (a jpg file or a png file on the top of the email containing the clinic name and the statement APPOINTMENT REMINDER). For this I added the following piece of code:

<img src='http://nahahealthclinic.no-ip.org/public/nhc_appt_header1.jpg'/><BR>
<BR>

I added the code below this line in the HTML of the Automatic reminder

<html>
<head><title>Doctor Appointment Reminder</title></head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#F9F9F9" link="#006699" vlink="#006699" style="overflow-y:scroll;">

The problem is, Now the emails are not send and I receive this error -

[18-Jun-2015 23:47:50 Asia/Kolkata] SQL Error with statement:query failed: INSERT INTO `notification_log` ( `iLogId` , `pid` , `pc_eid` , `sms_gateway_type` , `message` , `email_sender` , `email_subject` , `type` , `patient_info` , `smsgateway_info` , `pc_eventDate` , `pc_endDate` , `pc_startTime` , `pc_endTime` , `dSentDateTime` ) VALUES (NULL , '1', '34', '', '<html>

This error gets corrected if I remove the image code which I added. Can anybody please help with the proper html code needed to display the image?

teryhill wrote on Thursday, June 18, 2015:

So the problem is not a html problem. The problem is that you are trying to save an image file in a text field. You can try changing the field type to blob (do this on your test machine) and see if that works. Then if it does you will need to investigate what will happen to existing data if you change the field type. Maybe best to forget the image.

Terry

arnabnaha wrote on Friday, June 19, 2015:

Hi Terry

thanks for the input…I tried changing the “messege” field type in both “Automatic_Notificatiob” table and “Notification_Log” Table from text to BLOB, it didnt work. Again changed it to LONGBLOB (Just hit and try) and it didnt work too. this is the error messege which shows up when trying to send the email

Total 1 Records Found

ERROR: query failed: INSERT INTO `notification_log` ( `iLogId` , `pid` , `pc_eid` , `sms_gateway_type` , `message` , `email_sender` , `email_subject` , `type` , `patient_info` , `smsgateway_info` , `pc_eventDate` , `pc_endDate` , `pc_startTime` , `pc_endTime` , `dSentDateTime` ) VALUES (NULL , '1', '42', '', '<html> <head><title>Doctor Appointment Reminder</title></head> <body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#F9F9F9" link="#006699" vlink="#006699" style="overflow-y:scroll;"> <img src='http://nahahealthclinic.no-ip.org/public/nhc_appt_header1.jpg'/><BR> <BR> This is to remind you of the following appointment at Naha Health Clinic to see <B>***PROVIDER***</B>: <BR> <BR> Appointment for : <B>***NAME***</B><BR> Time, Day and Date : <B>***STARTTIME***</B> on <B>***DATE***</B><BR> Address of Clinic : <B>B1/102, Panchsheel Housing Complex, M.B. Road, Birati, Kolkata - 700051</B><BR> <BR> If you are unable to keep this appointment, please call our office at 03325396068.<BR> <BR> For <B>NEW PATIENTS</B>,please bring the following documents along with you:-<BR> <BR> 1. Your ID card (Passport, Driving License, Voter ID Card, Aadhaar Card, etc)<BR> <BR> 2. Your Address proof (Passport, Driving License, Voter ID Card, Ration Card, Aadhaar Card, etc)<BR> <BR> 3.All your previous medical records, test reports and prescription (if any)<BR> <BR> <BR> For <B>EXISTING PATIENTS/ESTABLISHED PATIENTS</B>, please bring the medical record file we supplied you on your first visit with the patient ID.<BR> <BR> <BR> We look forward to seeing you.<BR> <BR> Thank you.<BR> <BR> Naha Health Clinic Team<BR> for ***PROVIDER***.<BR> <BR> <BR> <BR> <HR> <BR> <small>Please let us know if you prefer <B>not</B> to receive the email reminders about your future appointments.</small> </body> </html>', 'admin@nahahealthclinic.org', 'Naha Health Clinic - Appointment Reminder Mail', 'Email', 'Mr. Arup Kumar Naha|||8583938487|||naha.arup@gmail.com', 'admin@nahahealthclinic.org|||Naha Health Clinic - Appointment Reminder Mail', '2015-06-20', '0000-00-00', '15:30:00', '15:45:00', '2015-06-19 11:13:23')


C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_functions.php at 314:sqlStatement
C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_email_notification.php at 66:cron_InsertNotificationLogEntry(Email,Array,Array)

bradymiller wrote on Friday, June 19, 2015:

Hi,

Your not bringing in an image (just an image link), so probably why blob didn’t help.

Sounds like an escaping issue. Are you using the cron script (that query is not using binding to escape the sql query).

Try changing the single quotes to double quotes in your img src tag line.

-brady
OpenEMR

arnabnaha wrote on Friday, June 19, 2015:

Thank You Brady…it worked like a charm. No more error messages…Email going via the cron script smoothly…Thank you so much…