Обучаю битриксу программистов, интеграторов. Подробнee ⇒

Подробная информация о заказе для почты



Проблема: В стандартных шаблонах писем Битрикс нет красивого вывода информации о товарах и  многой другой информации о заказе и пользователе.
Можно воспользоваться компонентом "подробная информация о заказе для почты" - sale.personal.order.detail.mail
в параметре компонента по умолчанию Идентификатор заказа #ORDER_ID#
Надо #ORDER_REAL_ID#

там куча настроек, что можно вывести, в т.ч. фото товара, ссылку на товар, поля товара. параметры пользователя и пр

шаблон компонента можно скопировать в свое пространство имен и доработать

доработанный template.php
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?use \Bitrix\Main\Localization\Loc;?>
<?if($arParams["SHOW_ORDER_BASE"]=='Y' && (strlen($arResult["ERROR_MESSAGE"]) || $arResult["ACCOUNT_NUMBER"])):?>
   <div class="wrapper_block" style="color:#888888;font-size:12px;padding:0px;margin-top:10px;margin-bottom:10px; background:#fff;">
      <?if(strlen($arResult["ERROR_MESSAGE"])):?>
         <div style="font-size:14px;color:#c00;"><?=ShowError($arResult["ERROR_MESSAGE"]);?></div>
      <?else:?>   
         <?$allCurrency = CSaleLang::GetLangCurrency($arParams["SITE_ID"]);?>
         <h3 style="font-weight:400;color: #1d2029;font-size:20px;"><?=Loc::getMessage("SPOD_ORDER_TITLE", array("#ORDER_NUMBER#" => $arResult["ACCOUNT_NUMBER"], "#ORDER_DATE#" => $arResult["DATE_INSERT_FORMATED"]));?></h3>
         <div style="border:1px solid #dedede;margin-top:21px;">
            <?if($arParams["SHOW_ORDER_BASE"]=='Y'):?>
               <div style="background:#f7f7f7;border-bottom:1px solid #dedede;padding:22px 21px 0px;font-size:0px;">
                  <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;padding-bottom: 22px;">
                     <?=Loc::getMessage('SPOD_ORDER_STATUS');?> <span style="font-weight:600;color:#000;"><?=htmlspecialcharsbx($arResult["STATUS"]["NAME"]) ?></span> <?=Loc::getMessage('SPOD_ORDER_DATE_FROM', array("#ORDER_DATE#" => $arResult["DATE_INSERT_FORMATED"]));?>
                  </div>
                  <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width: 145px;padding-bottom: 22px;">
                     <div><?=Loc::getMessage('SPOD_ORDER_SUMM');?></div>
                     <div style="font-size:18px;color:#1d2029;font-weight:600;padding-top:5px;"><?=CAllCurrencyLang::CurrencyFormat($arResult["PRICE"], $allCurrency);?></div>
                  </div>
                  <?if($arResult["CANCELED"] == "Y" || $arResult["CAN_CANCEL"] == "Y"):?>   
                     <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width: 145px;padding-bottom: 22px;">
                        <?if($arResult["CANCELED"] == "Y"):?>
                           <div><?=Loc::getMessage('SPOD_ORDER_CANCELED');?></div>
                           <div style="font-size:18px;color:#1d2029;font-weight:600;padding-top:5px;">
                              <?=GetMessage('SPOD_YES')?><?if(strlen($arResult["DATE_CANCELED_FORMATED"])):?><?=Loc::getMessage('SPOD_ORDER_DATE_FROM', array("#ORDER_DATE#" => $arResult["DATE_CANCELED_FORMATED"]));?><?endif?>
                           </div>
                        <?elseif($arResult["CAN_CANCEL"] == "Y"):?>
                           <div style="font-size:18px;color:#1d2029;text-align:right;">
                              <a href="<?=str_replace("ORDER_ID", $arResult["ACCOUNT_NUMBER"], $arResult["URL_TO_CANCEL"]);?>" style="display:inline-block;font-size:14px;border-radius:3px;padding: 11px 19px;color:<?=$arParams["THEME_COLOR"]?>;background:#f7f7f7;border:1px solid <?=$arParams["THEME_COLOR"]?>;"><?=Loc::getMessage("SPOD_ORDER_CANCEL")?></a>
                           </div>
                        <?endif;?>
                     </div>
                  <?endif;?>
               </div>
            <?endif;?>
         </div>
         <?if($arParams["SHOW_ORDER_BASKET"]=='Y' && $arResult["BASKET"]):?>
            <?$arHeaders = array("NAME", "DISCOUNT", "QUANTITY", "SUMM");
            $allCurrency = CSaleLang::GetLangCurrency($arParams["SITE_ID"]);
            $summ = 0;
            if($arParams['CUSTOM_SELECT_PROPS'])
            {
               foreach($arParams['CUSTOM_SELECT_PROPS'] as $key => $headerId)
               {
                  if(in_array($headerId, $arHeaders) || $headerId == 'PICTURE')
                     unset($arParams['CUSTOM_SELECT_PROPS'][$key]);
               }
            }?>
            <div style="color:#1d2029;font-size:18px;padding: 22px 0px 18px;font-weight:600;"><?=Loc::getMessage('SPOD_ORDER_BASKET')?></div>
            <div style="border: 1px solid #e7e7e7;border-bottom-width:0px;">
               <div style="overflow: auto;-webkit-overflow-scrolling: touch;">
                  <table class="sale_basket_small" width="100%" style="margin:0;padding:0;width:100%; border-collapse: collapse;table-layout:fixed">
                     <thead>
                        <tr style="background:#f7f7f7;">                           
                           <?foreach($arHeaders as $name):
                              if($name=="NAME"){
                                 $width = 'width:33%;';
                              }
                              elseif($name=="QUANTITY"){
                                 $width = 'width:40px;';
                              }
                              else{
                                 $width = '';
                              }?>
                              <td style="white-space:nowrap;border-bottom: 1px solid #e7e7e7;padding: 7px 7px 8px 7px;font-size: 12px;line-height: 20px;background: none;color: #888;<?=$width;?>">
                                 <?=Loc::getMessage("SPOD_HEADER_".$name);?>                              
                              </td>
                              <?if($name=="NAME"):?>
                                 <td style="white-space:nowrap;border-bottom: 1px solid #e7e7e7;padding: 7px 7px 8px 7px;font-size: 12px;line-height: 20px;background: none;color: #888; width:25%">
                                    Артикул, код                           
                                 </td>
                              <?endif;?>
                           <?endforeach;?>
                        </tr>
                     </thead>
                     <tbody>
                        <?foreach($arResult["BASKET"] as $arItem):
                           $arItem["PRICE"] = str_replace("-", "", $arItem["PRICE"]);?>
                           <tr>
                              <?foreach($arHeaders as $name):?>
                                 <td style="padding:18px 7px;border-bottom: 1px solid #e7e7e7;color:#666;font-size:13px;vertical-align:top;">
                                    <?if($name == "NAME"):?>
                                       <?if($arItem["PREVIEW_PICTURE"]){
                                          $img = CFile::ResizeImageGet($arItem["PREVIEW_PICTURE"], array("width" => 75, "height" => 75), BX_RESIZE_PROPORTIONAL_ALT);
                                          // $src= str_replace(array("//", ""), array("/", "://"), $arParams["SITE_ADDRESS"].$img["src"]);
                                       }?>
                                       <div class="item" <?=($arItem["PREVIEW_PICTURE"] ? 'style="position:relative; min-height:75px;font-size:0px;"' : '');?>>
                                          <?if($arItem["PREVIEW_PICTURE"]):?>
                                                <div class="img" style="display:inline-block;width:75px;text-align:center;height:75px;vertical-align:top; margin-right: 10px;">
                                                   <img src="<?=$img["src"];?>" alt="<?=$arItem[$name];?>" title="<?=$arItem[$name];?>" style="display: inline-block;vertical-align:middle;max-width:100%;max-height:100%;" />
                                                </div>
                                                <div style="display: inline-block;width: 107px;font-size:13px;vertical-align:top;">
                                          <?endif;?>
                                          <a style="color:<?=$arParams["THEME_COLOR"];?>;" href="<?=(str_replace(array("//", ""), array("/", "://"), $arParams["SITE_ADDRESS"].$arItem["DETAIL_PAGE_URL"]));?>"><?=$arItem[$name];?></a>                                          

                                          <?if($arItem["PREVIEW_PICTURE"]):?>
                                             </div>
                                          <?endif;?>
                                       </div>
                                       </td>
                                       <td style="padding:18px 7px;border-bottom: 1px solid #e7e7e7;color:#666;font-size:13px;vertical-align:top;">
                                          <?if($arParams['CUSTOM_SELECT_PROPS']):
                                             $actuallyHasProps = is_array($arItem["PROPS"]) && !empty($arItem["PROPS"]);?>
                                             <div style="color:#888;font-size:12px;padding-top:0px;padding-bottom:10px;">
                                                <?foreach ($arParams['CUSTOM_SELECT_PROPS'] as $id => $headerId){
                                                   $headerName = Loc::getMessage('SPOD_'.$headerId);
                                                   
                                                   if(strlen($headerName)<=0)
                                                   {
                                                      foreach(array_values($arResult['PROPERTY_DESCRIPTION']) as $prop_head_desc):
                                                         if(array_key_exists($headerId, $prop_head_desc))
                                                            $headerName = $prop_head_desc[$headerId]['NAME'];
                                                      endforeach;
                                                   }
                                                   if($headerId == "PROPS" && $arResult['HAS_PROPS'] && $actuallyHasProps):?>
                                                      <?foreach($arItem["PROPS"] as $prop):?>
                                                         <div><?=$prop["NAME"]?>: <?=$prop["VALUE"]?></div>
                                                      <?endforeach?>
                                                   <?else:
                                                      $value = (strpos($headerId, 'PROPERTY_')===0 ? $headerId."_VALUE" : $headerId."_not_use");
                                                      if($arItem[$value]):?>
                                                         <div><?=$headerName;?>: <?=$arItem[$value]?></div>
                                                      <?endif;?>
                                                   <?endif;?>
                                                <?}?>
                                             </div>
                                          <?else:?>
                                              
                                          <?endif;?>
                                    <?elseif($name == "DISCOUNT"):?>
                                       <?=CAllCurrencyLang::CurrencyFormat($arItem["PRICE"], $allCurrency);?>
                                    <?elseif($name == "SUMM"):?>
                                       <div style="font-weight:600;font-size:14px;color:#333333;"><?=CAllCurrencyLang::CurrencyFormat($arItem["PRICE"]*$arItem["QUANTITY"], $allCurrency);?></div>
                                    <?else:?>
                                       <?=$arItem[$name];?>
                                    <?endif;?>
                                 </td>
                              <?endforeach;?>
                           </tr>
                        <?endforeach;?>

                     </tbody>
                  </table>
               </div>
               <?if($arParams["SHOW_ORDER_SUM"]=='Y'):?>
                  <div style="padding:22px 21px;text-align:right;border-bottom:1px solid #e7e7e7;background:#f7f7f7;color:#333333;">
                     <div style="display:inline-block;font-size:0px;">
                        <? ///// WEIGHT ?>
                        <?if(floatval($arResult["ORDER_WEIGHT"])):?>
                           <div>
                              <div style="display:inline-block;vertical-align:top;font-size:15px;width:170px;text-align:left;"><?=Loc::getMessage('SPOD_TOTAL_WEIGHT')?></div>
                              <div style="display:inline-block;vertical-align:top;font-size:16px;width:120px;text-align:right;font-weight:600;"><?=$arResult['ORDER_WEIGHT_FORMATED']?></div>
                           </div>
                        <?endif;?>

                        <? ///// PRICE SUM ?>
                        <div>
                           <div style="display:inline-block;vertical-align:top;font-size:15px;width:170px;text-align:left;"><?=Loc::getMessage('SPOD_PRODUCT_SUM')?></div>
                           <div style="display:inline-block;vertical-align:top;font-size:16px;width:120px;text-align:right;font-weight:600;"><?=$arResult['PRODUCT_SUM_FORMATTED']?></div>
                        </div>

                        <? ///// DELIVERY PRICE: print even equals 2 zero ?>
                        <?if(strlen($arResult["PRICE_DELIVERY_FORMATED"])):?>
                           <div>
                              <div style="display:inline-block;vertical-align:top;font-size:15px;width:170px;text-align:left;"><?=Loc::getMessage('SPOD_DELIVERY')?></div>
                              <div style="display:inline-block;vertical-align:top;font-size:16px;width:120px;text-align:right;font-weight:600;"><?=CAllCurrencyLang::CurrencyFormat($arResult['PRICE_DELIVERY'], $allCurrency)?></div>
                           </div>
                        <?endif;?>

                        <? ///// TAXES DETAIL ?>
                        <?foreach($arResult["TAX_LIST"] as $tax):?>
                           <div>
                              <div style="display:inline-block;vertical-align:top;font-size:15px;width:170px;text-align:left;"><?=$tax["TAX_NAME"]?></div>
                              <div style="display:inline-block;vertical-align:top;font-size:16px;width:120px;text-align:right;font-weight:600;"><?=$tax["VALUE_MONEY_FORMATED"]?></div>
                           </div>
                        <?endforeach;?>

                        <? ///// TAX SUM ?>
                        <?if(floatval($arResult["TAX_VALUE"])):?>
                           <div>
                              <div style="display:inline-block;vertical-align:top;font-size:15px;width:170px;text-align:left;"><?=Loc::getMessage('SPOD_TAX')?></div>
                              <div style="display:inline-block;vertical-align:top;font-size:16px;width:120px;text-align:right;font-weight:600;"><?=$arResult['TAX_VALUE_FORMATED']?></div>
                           </div>
                        <?endif;?>

                        <? ///// DISCOUNT ?>
                        <?if(floatval($arResult["DISCOUNT_VALUE"])):?>
                           <div>
                              <div style="display:inline-block;vertical-align:top;font-size:15px;width:170px;text-align:left;"><?=Loc::getMessage('SPOD_DISCOUNT')?></div>
                              <div style="display:inline-block;vertical-align:top;font-size:16px;width:120px;text-align:right;font-weight:600;"><?=CAllCurrencyLang::CurrencyFormat($arResult['DISCOUNT_VALUE'], $allCurrency)?></div>
                           </div>
                        <?endif;?>

                        <div>
                           <div style="display:inline-block;vertical-align:top;font-size:15px;width:170px;text-align:left;"><?=Loc::getMessage('SPOD_SUMMARY')?></div>
                           <div style="display:inline-block;vertical-align:top;font-size:16px;width:120px;text-align:right;font-weight:600;"><?=CAllCurrencyLang::CurrencyFormat($arResult['PRICE'], $allCurrency)?></div>
                        </div>
                     </div>
                  </div>
               <?endif;?>
            </div>
         <?endif;?>
         <div style="border:1px solid #dedede;margin-top:21px;">
            <?if($arParams["SHOW_ORDER_USER"]=='Y'):?>
               <?if(intval($arResult["USER_ID"])):?>
                  <div style="border-bottom:1px solid #dedede;padding:22px 21px;font-size:0px;">
                     <div style="font-size:15px;color:#1d2029;font-weight:600;"><?=Loc::getMessage('SPOD_ACCOUNT_DATA');?></div>
                     <?if(strlen($arResult["USER_NAME"])):?>
                        <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width: 145px;padding-top:18px;padding-right: 6px;box-sizing: border-box;">
                           <div><?=Loc::getMessage('SPOD_ACCOUNT');?></div>
                           <div style="font-size:14px;color:#1d2029;padding-top:5px;"><?=$arResult["USER_NAME"]?></div>
                        </div>
                     <?endif;?>
                     <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width: 145px;padding-top:18px;padding-right: 6px;box-sizing: border-box;">
                        <div><?=Loc::getMessage('SPOD_LOGIN');?></div>
                        <div style="font-size:14px;color:#1d2029;padding-top:5px;overflow: hidden;text-overflow: ellipsis;"><?=$arResult["USER"]["LOGIN"]?></div>
                     </div>
                     <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width: 145px;padding-top:18px;">
                        <div><?=Loc::getMessage('SPOD_EMAIL');?></div>
                        <div style="font-size:14px;color:#1d2029;padding-top:5px;"><a style="color:<?=$arParams["THEME_COLOR"]?>;" href="mailto:<?=$arResult["USER"]["EMAIL"]?>"><?=$arResult["USER"]["EMAIL"]?></a></div>
                     </div>
                  </div>
               <?endif?>
            <?endif?>            
            <?if(($arParams["SHOW_ORDER_BUYER"]=='Y')||($arParams["SHOW_ORDER_PAYMENT"]=='Y')):?>   
               <div style="border-bottom:1px solid #dedede;padding:22px 21px;font-size:0px;">
                  <?if($arParams["SHOW_ORDER_BUYER"]=='Y'):?>               
                     <div style="font-size:15px;color:#1d2029;font-weight:600;">Данные заказа</div>
                     <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width:145px;padding-top:18px;">
                        <div><?=Loc::getMessage('SPOD_ORDER_PERS_TYPE');?></div>
                        <div style="font-size:14px;color:#1d2029;padding-top:5px;"><?=$arResult["PERSON_TYPE"]["NAME"]?></div>
                     </div>
                     <?foreach($arResult["ORDER_PROPS"] as $prop):?>
                        <?if($prop["TYPE"] != "CHECKBOX" && !$prop["VALUE"])
                           continue;?>
                        <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width:<?=($prop["CODE"]=="LOCATION")?'435':'145'?>px;padding-top:18px;padding-right: 6px;box-sizing: border-box;">
                           <div><?=$prop['NAME']?>:</div>
                           <div style="font-size:14px;color:#1d2029;padding-top:5px;overflow: hidden;text-overflow: ellipsis;">
                              <?if($prop["TYPE"] == "CHECKBOX"):?>
                                 <?=Loc::getMessage('SPOD_'.($prop["VALUE"] == "Y" ? 'YES' : 'NO'))?>
                              <?else:?>
                                 <span style="<?=in_array($prop["CODE"],array("FIO","PHONE","ADDRESS","CITY"))?'font-weight:600;':''?>"><?=$prop["VALUE"]?></span>
                              <?endif?>
                           </div>
                        </div>
                     <?endforeach;?>
                     <?if(!empty($arResult["USER_DESCRIPTION"])):?>
                        <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;padding-top:18px;">
                           <div><?=Loc::getMessage('SPOD_ORDER_USER_COMMENT')?></div>
                           <div style="font-size:14px;color:#1d2029;padding-top:5px;font-weight:600;"><?=$arResult["USER_DESCRIPTION"]?></div>
                        </div>
                     <?endif?>
                  <?endif?>
                  <?if($arParams["SHOW_ORDER_PAYMENT"]=='Y'):?>                              
                     <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width:145px;padding-top:18px;padding-right: 6px;box-sizing: border-box;">
                        <div><?=Loc::getMessage('SPOD_PAY_SYSTEM');?></div>
                        <div style="font-size:14px;color:#1d2029;padding-top:5px;overflow: hidden;text-overflow: ellipsis;">
                           <span style="font-weight:600;">
                           <?if(intval($arResult["PAY_SYSTEM_ID"])):?>
                              <?=$arResult["PAY_SYSTEM"]["NAME"]?>
                           <?else:?>
                              <?=Loc::getMessage("SPOD_NONE")?>
                           <?endif?>
                           </span>
                        </div>
                     </div>
                     <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width:145px;padding-top:18px;padding-right: 6px;box-sizing: border-box;">
                        <div><?=Loc::getMessage('SPOD_ORDER_PAYED');?></div>
                        <div style="font-size:14px;color:#1d2029;padding-top:5px;overflow: hidden;text-overflow: ellipsis;">
                           <?if($arResult["PAYED"] == "Y"):?>
                              <span style="font-weight:600;"><?=Loc::getMessage("SPOD_YES")?></span><?if(strlen($arResult["DATE_PAYED_FORMATED"])):?><?=Loc::getMessage('SPOD_ORDER_DATE_FROM', array("#ORDER_DATE#" => $arResult["DATE_PAYED_FORMATED"]));?><?endif?>
                           <?else:?>
                              <span style="font-weight:600;"><?=Loc::getMessage("SPOD_NO")?></span>
                           <?endif?>
                        </div>
                     </div>
                     <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width:145px;padding-top:18px;padding-right: 6px;box-sizing: border-box;">
                        <div><?=Loc::getMessage('SPOD_ORDER_DELIVERY');?></div>
                        <div style="font-size:14px;color:#1d2029;padding-top:5px;overflow: hidden;text-overflow: ellipsis;">
                           <span style="font-weight:600;">
                              <?if(strpos($arResult["DELIVERY_ID"], ":") !== false || intval($arResult["DELIVERY_ID"])):?>
                                 <?=$arResult["DELIVERY"]["NAME"]?>                              
                              <?else:?>
                                 <?=Loc::getMessage("SPOD_NONE")?>
                              <?endif?>
                           </span>
                        </div>
                     </div>
                     <?if((intval($arResult["DELIVERY_ID"])==3) &&($arResult["STORE_ID"]>0)&&(!empty($arResult["DELIVERY"]["STORE_LIST"][$arResult["STORE_ID"]]["ADDRESS"]))):?>
                        <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width:145px;padding-top:18px;padding-right: 6px;box-sizing: border-box;">
                           <div>Самовывоз со склада</div>
                           <div style="font-size:14px;color:#1d2029;padding-top:5px;overflow: hidden;text-overflow: ellipsis;">
                              <span style="font-weight:600;">
                                 <?=$arResult["DELIVERY"]["STORE_LIST"][$arResult["STORE_ID"]]["ADDRESS"]?>
                              </span>
                           </div>
                        </div>

                     <?endif;?>
                     <?if($arResult["TRACKING_NUMBER"]):?>
                        <div style="display:inline-block;vertical-align:top;font-size:14px;width:100%;max-width:290px;padding-top:18px;">
                           <div><?=Loc::getMessage('SPOD_ORDER_TRACKING_NUMBER');?></div>
                           <div style="font-size:14px;color:#1d2029;padding-top:5px;"><?=$arResult["TRACKING_NUMBER"]?></div>
                        </div>
                     <?endif;?>                  
                  <?endif?>
               </div>
            <?endif?>
         </div>
         
         <div style="text-align:center;">
            <div style="color:#555555;font-size:14px;padding: 27px 0px 17px;"><?= GetMessage("SALE_TOTAL") ?> <?=Loc::getMessage("PERSONAL_PAGE_TEXT");?></div>
            <?if($arParams["SHOW_PERSONAL"] == "Y" && $arParams["PERSONAL_PAGE"]):?>
               <a href="<?=$arParams["PERSONAL_PAGE"]?>" style="color:#fff;background:<?=$arParams["THEME_COLOR"];?>;padding:11px 19px;border-radius:3px;display: inline-block;font-size:14px;"><?=Loc::getMessage("PERSONAL_PAGE") ?></a>
            <?endif;?>
         </div>
      <?endif;?>
   </div>
<?endif;?>
result_modifier.php
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();

$cp = $this->__component;
if (is_object($cp))
{
   CModule::IncludeModule('iblock');

   if(empty($arResult['ERRORS']['FATAL']))
   {

      $hasDiscount = false;
      $hasProps = false;
      $productSum = 0;
      $basketRefs = array();

      $noPict = array(
         'SRC' => $this->GetFolder().'/images/no_photo.png'
      );

      if(is_readable($nPictFile = $_SERVER['DOCUMENT_ROOT'].$noPict['SRC']))
      {
         $noPictSize = getimagesize($nPictFile);
         $noPict['WIDTH'] = $noPictSize[0];
         $noPict['HEIGHT'] = $noPictSize[1];
      }

      foreach($arResult["BASKET"] as $k => &$prod)
      {
         if(floatval($prod['DISCOUNT_PRICE']))
            $hasDiscount = true;

         // move iblock props (if any) to basket props to have some kind of consistency
         if(isset($prod['IBLOCK_ID']))
         {
            $iblock = $prod['IBLOCK_ID'];
            if(isset($prod['PARENT']))
               $parentIblock = $prod['PARENT']['IBLOCK_ID'];

            foreach($arParams['CUSTOM_SELECT_PROPS'] as $prop)
            {
               $key = $prop.'_VALUE';
               if(isset($prod[$key]))
               {
                  // in the different iblocks we can have different properties under the same code
                  if(isset($arResult['PROPERTY_DESCRIPTION'][$iblock][$prop]))
                     $realProp = $arResult['PROPERTY_DESCRIPTION'][$iblock][$prop];
                  elseif(isset($arResult['PROPERTY_DESCRIPTION'][$parentIblock][$prop]))
                     $realProp = $arResult['PROPERTY_DESCRIPTION'][$parentIblock][$prop];
                  
                  if(!empty($realProp))
                     $prod['PROPS'][] = array(
                        'NAME' => $realProp['NAME'], 
                        'VALUE' => htmlspecialcharsEx($prod[$key])
                     );
               }
            }
         }

         // if we have props, show "properties" column
         if(!empty($prod['PROPS']))
            $hasProps = true;

         $productSum += $prod['PRICE'] * $prod['QUANTITY'];

         $basketRefs[$prod['PRODUCT_ID']][] =& $arResult["BASKET"][$k];

         if(!isset($prod['PICTURE']))
            $prod['PICTURE'] = $noPict;
      }

      $arResult['HAS_DISCOUNT'] = $hasDiscount;
      $arResult['HAS_PROPS'] = $hasProps;

      $arResult['PRODUCT_SUM_FORMATTED'] = SaleFormatCurrency($productSum, $arResult['CURRENCY']);

      if($img = intval($arResult["DELIVERY"]["STORE_LIST"][$arResult['STORE_ID']]['IMAGE_ID']))
      {

         $pict = CFile::ResizeImageGet($img, array(
            'width' => 150,
            'height' => 90
         ), BX_RESIZE_IMAGE_PROPORTIONAL_ALT, true);

         if(strlen($pict['src']))
            $pict = array_change_key_case($pict, CASE_UPPER);

         $arResult["DELIVERY"]["STORE_LIST"][$arResult['STORE_ID']]['IMAGE'] = $pict;
      }
      if($arResult['PROPERTY_DESCRIPTION'])
      {
         \Bitrix\Main\Loader::includeModule('iblock');
         foreach($arResult['PROPERTY_DESCRIPTION'] as $key => $arItems)
         {
            foreach($arItems as $key2 => $arProp)
            {
               $arPropNew = CIBlockProperty::GetList(Array("sort"=>"asc", "name"=>"asc"), Array("ACTIVE"=>"Y", "CODE"=> str_replace("PROPERTY_", "", $key2), "IBLOCK_ID" => 13))->Fetch();
               if($arPropNew["NAME"])
                  $arResult['PROPERTY_DESCRIPTION'][$key][$key2]["NAME"] = $arPropNew["NAME"];
            }
         }
      }
   }
}
?>
шаблон письма

header.php
<?require($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/aspro.max/classes/general/mailing_functions.php");?>
<!DOCTYPE html>
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=<?=$arSite['CHARSET'];?>" />
      <style type="text/css">
         .wrapper_block{margin:0;padding:0;background:#fff;font-family:Arial, sans-serif;font-size:13px;color:#525c70;line-height:20px;}
         #bxStylistHeader, .bxBlockContentButton{background:<?=$bg_color;?>;}
      </style>
   </head>
   <body style="height:100% !important;margin:0;padding:0;font-family: Arial, Helvetica, sans-serif;width:100% !important;background: #f9f9f9;min-width:300px !important;">
      <!-- mail-wrap -->
      <div class="mail-wrap <?=$type_color;?>" style="width:100%;max-width: 900px;margin: 20px auto;overflow:hidden;border-radius: 3px;background: #FFFFFF;">
         <center>
            <!-- top content -->
               <table class="mail-grid"   width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
                  <tr>
                     <td id="bxStylistHeader" style="margin-bottom:20px;padding-top: 0px;padding-right: 30px;padding-bottom: 0px;padding-left: 30px;background:#fff">
                        <!-- 2 cell -->
                        <table class="mail-grid"   width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
                           <tr>
                              <td width="50%" align="left">                                 
                                 <a href="/" class="link_img_logo" style="display: inline-block;zoom: 1;vertical-align: middle;margin: 0;max-width: 190px;">
                                    <img style="max-width:100%;background:<?=$bg_color_logo;?>;display:block;" data-bx-editor-def-image="0" src="<?=$logo_src;?>" class="bxImage">
                                 </a>
                              </td>
                              <td  width="50%" align="right">
                                 <?=str_replace("<a", "<a style='text-decoration:none;color:#1d2029;font-size:18px;display: block;word-wrap: break-word;'", $phone);?>
                              </td>                              
                           </tr>
                        </table>
                     </td>
                  </tr>
               </table>
            <!-- /top content -->
            
            <!-- main content -->
               <div class="main_content" style="padding-top:0px;padding-bottom:5px;text-align:left;padding-left:20px;padding-right:20px;">
footer.php
</div>
            <!-- /main content -->            
         </center>
      </div>
      <!-- /mail-wrap -->
      
      <!-- footer -->
         <div style="max-width: 600px;min-width:600px !important;width:100% !important;text-align:center;margin:0px auto;">
            <?global $copyright, $vk_social, $fb_social, $odn_social, $tw_social, $mail_social, $inst_social, $g_social, $y_social;?>
            <div style="color:#666666;font-size:13px;padding:10px 20px 0px 20px;"><?=date("Y")." ".$copyright;?></div>
            <div style="padding-bottom:30px;">
               <?EventMessageThemeCompiler::includeComponent(
                  "bitrix:news.list", 
                  "mail", 
                  array(
                     //параметры
                  ),
                  false
               );?>
            </div>
         </div>
      <!-- /footer -->
   </body>
</html>
Если блог был полезным, можете угостить меня "чашечкой кофе" :)

Сбер по номеру телефона +7 (953) 585-13-09 Вероника.
Спасибо!