<!DOCTYPE html>
<html lang="en" xmlns="https://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office">
<script type="text/dlbscript">// Inline script gets removed after build

  procedure UpdateSubjectByLanguage;
  begin
    if RcptISOLang = 'de' then CRMItem.Set_PreparedCaption('Betreffend XY')
    else if RcptISOLang = 'it' then CRMItem.Set_PreparedCaption('Per quanto riguarda XY')
    else if RcptISOLang = 'fr' then CRMItem.Set_PreparedCaption('Concernant XY')
    else
    CRMItem.Set_PreparedCaption('In case of xy');
  end;

  function PlaceDynamicImage(DataSetName: String; AWidth: Integer; AFormat: String = 'png'): String;
  var
    ImageData: TBytes;
    ImageFormat: String;
    DS: TDataSet;
  begin
    DS := Document.GetDataSetByName(DataSetName);

    if Assigned(DS) then
    begin
       DS.Active := true;

    if Document.LoadImageData(DataSetName, 'photoblob', 'photodocid', ImageData, ImageFormat) then
    begin
      if ConvertImage(ImageData, 0, AWidth, AFormat) then
      ImageFormat := AFormat;

      Result := Document.GetEmbedImageDataTag(ImageData, ImageFormat, DataSetName, '', 'width:' + IntToStr(AWidth) + 'px;');
    end else
      Result := '';
    end else
    Result := ''; 
  end;

  function RcptISOLang: String;
  begin
    {$IFDEF TranslationModule}
    Result := TranslationModule.Get_ISONameByLanguageID(CRMItem.Get_AddressValue('corresp_language_id', true), true, true);
    {$ELSE TranslationModule}
    Result := 'de';
    {$ENDIF TranslationModule}
  end;

  function IFLang(ALang, Value: String): String;
  begin
    if ALang = RcptISOLang then
      Result := Value
    else
      Result := '';
  end;

  function IFnotEmpty(ACheckValue, APlaceValue: String): String;
  begin
    if Length(ACheckValue) > 0 then
      Result := APlaceValue
    else
      Result := '';
  end;

  procedure AddAttachementByLang;
  const
    DocPath = '\\SERVER\Data\Example\';
  begin
    if RcptISOLang = 'de' then AddAttachementFile(DocPath + 'German.pdf', 'Checkliste.pdf')
    else if RcptISOLang = 'it' then AddAttachementFile(DocPath + 'Italian.pdf', 'Lista di controllo.pdf')
    else if RcptISOLang = 'fr' then AddAttachementFile(DocPath + 'French.pdf', 'Liste de contrôle dè France.pdf')
    else AddAttachementFile(DocPath + 'English.pdf', 'Your check list.pdf');
  end;

  procedure Initialization;
  begin
    //UpdateSubjectByLanguage;
    //AddAttachementByLang;
  end;

//</script>
<head>
    <meta charset="utf-8"/>
    <meta content="width=device-width,initial-scale=1" name="viewport"/>
    <meta name="x-apple-disable-message-reformatting"/>
    <!--[if !mso]><!-->
    <meta content="IE=edge" http-equiv="X-UA-Compatible"/>
    <!--<![endif]-->
    <title></title>
    <!--[if mso]>
    <style type="text/css">
        table {border-collapse:collapse;border:0;border-spacing:0;margin:0;}
        div, td {padding:0;}
        div {margin:0 !important;}
        .dlb-auto-lnkpast-thumb-img {width:200;}
    </style>
    <noscript>
    <xml>
        <o:OfficeDocumentSettings>
            <o:PixelsPerInch>96</o:PixelsPerInch>
        </o:OfficeDocumentSettings>
    </xml>
    </noscript>
    <![endif]-->
</head>
<body style="margin:0;padding:10px;word-spacing:normal;background-color:#ffffff;font-family:Calibri;font-size:12pt;">

<report-objects>
  <object delight-ui-defaultselection="Sehr geehrt" delight-ui-displaycaption="Anredeform" delight-ui-displayfield="descr" delight-ui-mode="radio-group" name="salutation" sql="select * from textblocks WHERE templateblockcategoryid='Anredeformen'" type=""></object>
  <object delight-ui-defaultselection="Freundliche Grüsse" delight-ui-displaycaption="Grussform" delight-ui-displayfield="descr" delight-ui-mode="radio-group" name="greetings" sql="select * from textblocks WHERE templateblockcategoryid='Grussformen'" type=""></object>
  <object delight-ui-defaultselectionscript="IFLang('de', 'Aktuell')" delight-ui-displaycaption="Werbung" delight-ui-displayfield="descr" delight-ui-filterscript="RcptISOLang = 'de'" delight-ui-mode="check-group" name="commercials_de" sql="select * from textblocks WHERE templateblockcategoryid='Werbung' and contentlanguageid='German'" type=""></object>
  <object delight-ui-defaultselectionscript="IFLang('en', 'Hot')" delight-ui-displaycaption="Commercial" delight-ui-displayfield="descr" delight-ui-filterscript="RcptISOLang = 'en'" delight-ui-mode="check-group" name="commercials_en" sql="select * from textblocks WHERE templateblockcategoryid='Werbung' and contentlanguageid='English'" type=""></object>
</report-objects>

    <div aria-roledescription="email" lang="en" role="article" style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;background-color:#ffffff;">
        <table role="presentation" style="width:100%;border:0;border-spacing:0;font-size:12pt;">
            
        <tbody><tr>
                <td align="left">
                 
<!-- insert content here start -->

<div class="delight-dynamicblock" style="font-size:12pt;">{{#salutation}} {{#ISUISELECTED}} {{{BLOCKCONTENT}}} {{/ISUISELECTED}} {{/salutation}}</div>

<p style="font-size:12pt;"><span style="font-family:Calibri;">&nbsp;</span></p>

<div class="delight-dynamicblock" style="font-size:12pt;">{{#greetings}} {{#ISUISELECTED}} {{{BLOCKCONTENT}}} {{/ISUISELECTED}} {{/greetings}}</div>
<div class="delight-dynamicblock" style="font-size:12pt;">{{#commercials_de}} {{#ISUISELECTED}} {{{BLOCKCONTENT}}} {{/ISUISELECTED}} {{/commercials_de}}</div>
<div class="delight-dynamicblock" style="font-size:12pt;">{{#commercials_en}} {{#ISUISELECTED}} {{{BLOCKCONTENT}}} {{/ISUISELECTED}} {{/commercials_en}}</div>

<!-- insert content here end -->

                </td>
            </tr>

            <tr>
            <td align="left" style="padding-top:60px;">
<div>[ParentAction.Attachement.Header]<br/>
[ParentAction.Attachement.Body]<br/>
[ParentAction.Attachement.ForwardAttachements]</div>
            </td>
            </tr>

            </tbody></table>
    </div>
</body>


</html>