pears.EmailBody

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

CREATE FUNCTION "pears"."EmailBody"( IN "docid" CHAR(20) ) 
RETURNS long VARCHAR //
// IF you have General Setting GROUP OF Accounts NUMBER 420 'Allow users to modify invoice email body text' SET TO Y THEN the docid will NOT be used AS a parameter AS the FUNCTION IS NOT called.
BEGIN
  DECLARE "rv" long VARCHAR;
  DECLARE "invno" CHAR(12);
  DECLARE "coname" CHAR(30);
  DECLARE "crlf" CHAR(2);
  SELECT "ourref" INTO "invno" FROM "iqacdocument" WHERE "documentid" = "docid";
  SELECT "dbname" INTO "coname" FROM "params";
  SET "crlf" = "char"(13)+"char"(10);
  SET "rv" = "string"('Please find Invoice {invno} attached. ','If relevant, associated timesheets are included as additional pages in the attached invoice pdf.',"crlf");
  SET "rv" = "string"("rv","crlf");
  SET "rv" = "string"("rv",'Regards',"crlf");
  SET "rv" = "string"("rv","coname","crlf");
  SET "rv" = "string"("rv","crlf");
  SET "rv" = "string"("rv",'If you are not the addressee indicated in this message (or responsible for delivery of the message to such person),');
  SET "rv" = "string"("rv",'you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email.');
  RETURN("rv")
END
  • database/functions/pears_emailbody.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1