Table of Content
HAL Forum
procedure AddTextLineToMail (
string Text,var record MailVc Mail)
Description:
Adds a line to e-mail and performs carriage return.
Parameters:
Text String containing text that will be added to the mail
Mail E-mail record that will receive the line
external procedure AddTextLineToMail(string,record MailVc);

updating procedure CreateConfirmMail(record CUVc CUr,record JobVc Jobr)
begin
  record MailVc Mailr;
  record EmailBlock EMr;
  record MailSettingsBlock MSr;
  record CYBlock CYr;
  row MailVc Mailrw;

  if (LoggedInTest()) then begin
    BlockLoad(MSr);
    BlockLoad(EMr);
    BlockLoad(CYr);
    RecordNew(Mailr);
    Mailr.TransDate = CurrentDate;
    Mailr.TransTime = CurrentTime;
    Mailr.Lifespan = 0;
    Mailr.Header = "Confirmation of reservation for " & CUr.Name;
    Mailr.LockedFlag = 0;
    Mailr.SendFlag = 1;
    Mailr.HasFileAtt = 0;
    Mailr.HasRecAtt = 0;
    Mailrw.RowTyp = 1;
    Mailrw.AddrCode = EMr.UserIP;
    if (blank(Mailrw.AddrCode)) then begin
      Mailrw.AddrCode = MSr.Postmaster;
    end;
    MatRowPut(Mailr,0,Mailrw);
    Mailrw.RowTyp = 0;
    Mailrw.AddrCode = CUr.eMail;
    if (nonblank(Mailrw.AddrCode)) then begin
      MatRowPut(Mailr,1,Mailrw);
      AddTextLineToMail("Confirmation of reservation in " & CYr.CompName,Mailr);
      AddTextLineToMail("Your reservation is confirmed.",Mailr);
      AddTextLineToMail("Your reservation nr is: " & Jobr.SerNr,Mailr);
      if (RecordInsert(Mailr,true)) then begin end;
    end;
  end;
  return;
end;

Related topics:
««