I want to read HTML templates which i have already import in templates table and i want to use this templates in email to customers
mention below are the codes for import templates.
ImportTemplate - OnAction()
Rec.CALCFIELDS(ImportTemp);
IF Rec.ImportTemp.HASVALUE THEN
MESSAGE('Template is alredy Uploaded');
IF NOT CONFIRM('Do you want to ReUpload?') THEN
EXIT;
FileName := Filemgm.BLOBImportWithFilter(TempBlob, 'Upload File', '', 'All Files (*.*)|*.HTML*', '.HTML');
TempBlob.Blob.CREATEINSTREAM(Ins);
Rec.ImportTemp.CREATEOUTSTREAM(Outs);
COPYSTREAM(Outs, Ins);
IF TempBlob.Length()>5000000 THEN
ERROR('File size must be less than or equal to 3MB')
ELSE BEGIN
Rec.MODIFY(TRUE);
MESSAGE('File Uploaded');
END;
ExportTemplate - OnAction()
Rec.CALCFIELDS(ImportTemp);
Rec.ImportTemp.CREATEINSTREAM(Ins);
TempBlob.Blob.CREATEOUTSTREAM(Outs);
COPYSTREAM(Outs,Ins);
IF Rec.ImportTemp.HASVALUE THEN
FilemngCU.BLOBExport(TempBlob, FileName + 'Parcel.html', TRUE)
ELSE
ERROR('File Not found');