Таблица рекомендаций по поиску Ampscript с изображениями продуктов, URL-адресами и именами - PullRequest
0 голосов
/ 26 сентября 2018

У меня есть эта таблица (Product_Recommendations) рекомендуемых продуктов (4) для каждого адреса электронной почты.

<style type="text/css">
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
.tg .tg-0lax{text-align:left;vertical-align:top}
</style>
<table class="tg">
  <tr>
    <th class="tg-0lax">EmailAddress</th>
    <th class="tg-0lax">Product_Name_1</th>
    <th class="tg-0lax">Product_Image_1</th>
    <th class="tg-0lax">Product_URL_1</th>
    <th class="tg-0lax">Product_Name_2</th>
    <th class="tg-0lax">Product_Image_2</th>
    <th class="tg-0lax">Product_URL_2</th>
    <th class="tg-0lax">Product_Name_3</th>
    <th class="tg-0lax">Product_Image_3</th>
    <th class="tg-0lax">Product_URL_3</th>
    <th class="tg-0lax">Product_Name_4</th>
    <th class="tg-0lax">Product_Image_4</th>
    <th class="tg-0lax">Product_URL_4</th>
  </tr>
  <tr>
    <td class="tg-0lax">test1@gmail.com</td>
    <td class="tg-0lax">Banana Chips</td>
    <td class="tg-0lax">https://images-na.ssl-images-amazon.com/images/I/81U4W10VayL._SY679_.jpg</td>
    <td class="tg-0lax">https://www.amazon.com/dp/B079VYSKDL/</td>
    <td class="tg-0lax">Rice Krispie Squares</td>
    <td class="tg-0lax">http://images.kglobalservices.com/www.ricekrispies.ca_en/en_ca/recipe/kicrecipe-23578/kicfileasset-122362__0048_original_vanilla.jpg</td>
    <td class="tg-0lax">http://www.ricekrispies.ca/en_CA/recipes/original-rice-krispie-squares-with-vanilla-rice-krispies-recipe.html</td>
    <td class="tg-0lax">Peanut Butter</td>
    <td class="tg-0lax">https://ll-us-i5.wal.co/asr/c8947428-64a5-4fc8-b8a6-f39e99f4e8ff_1.be53020d2e3a614597a2e922384cbe0b.jpeg-65dd04924f94d1da234876f07ed26ed101838351-optim-450x450.jpg?odnBg=FFFFFF</td>
    <td class="tg-0lax">https://www.amazon.com/Skippy-Creamy-Peanut-Butter-Ounce/dp/B0005ZH4QI</td>
    <td class="tg-0lax">Gatorade</td>
    <td class="tg-0lax">https://images-na.ssl-images-amazon.com/images/I/71tpcOn5JoL._SY679_.jpg</td>
    <td class="tg-0lax">https://www.amazon.com/Gatorade-Thirst-Quencher-Glacier-Freeze/dp/B000R32OOU/ref=pd_sim_325_5?_encoding=UTF8&amp;pd_rd_i=B000R32OOU&amp;pd_rd_r=559a5bc6-c1b9-11e8-a3f5-a953cb310f5f&amp;pd_rd_w=fWcKC&amp;pd_rd_wg=yJcCm&amp;pf_rd_i=desktop-dp-sims&amp;pf_rd_m=ATVPDKIKX0DER&amp;pf_rd_p=18bb0b78-4200-49b9-ac91-f141d61a1780&amp;pf_rd_r=2Z91KVV5TEG2Q2ZQ4570&amp;pf_rd_s=desktop-dp-sims&amp;pf_rd_t=40701&amp;psc=1&amp;refRID=2Z91KVV5TEG2Q2ZQ4570</td>
  </tr>
  <tr>
    <td class="tg-0lax">test2@gmail.com</td>
    <td class="tg-0lax">Applesauce</td>
    <td class="tg-0lax">https://images-na.ssl-images-amazon.com/images/I/811TRgBN2gL._SX522_.jpg</td>
    <td class="tg-0lax">https://www.amazon.com/dp/B073JGKQB9?</td>
    <td class="tg-0lax">Pepsi</td>
    <td class="tg-0lax">https://images-na.ssl-images-amazon.com/images/I/81I8cacfOUL._SX522_.jpg</td>
    <td class="tg-0lax">https://www.amazon.com/dp/B00NU5ZZJI/ref=sspa_dk_detail_5?psc=1&amp;fpw=pantry</td>
    <td class="tg-0lax">Cashews</td>
    <td class="tg-0lax">https://images-na.ssl-images-amazon.com/images/I/51b00pIFJnL.jpg</td>
    <td class="tg-0lax">https://www.amazon.com/dp/B01H5GB8ZW/ref=sspa_dk_detail_5?psc=1&amp;fpw=pantry</td>
    <td class="tg-0lax">Cheerios</td>
    <td class="tg-0lax">https://images-na.ssl-images-amazon.com/images/I/91DlHO9Y69L._SY679_.jpg</td>
    <td class="tg-0lax">https://www.amazon.com/Cheerios-Naturally-Flavored-Sweetened-Cereal/dp/B07D3FFTH2/</td>
  </tr>
</table>

Я хочу добавить эти продукты в свою электронную почту, используя поиск по ampscript.Я попробовал следующее, но в Marketing Cloud произошла ошибка:

%%[ 
VAR @emailAddr, @p1_name, @p1_url, @p1_image
set @emailAddr = EmailAddress("emailaddr")
SET @p1_name = (Lookup("Product_Recommendation", "Product_Name_1" EmailAddress",@emailaddr))
SET @p1_url = (Lookup("Product_Recommendation", "Product_URL_1" EmailAddress",@emailaddr))
SET @p1_image = (Lookup("Product_Recommendation", "Product_Image_1" EmailAddress",@emailaddr)) 
]%%

Не уверен, что я делаю неправильно.Спасибо!

1 Ответ

0 голосов
/ 28 сентября 2018

Должно быть примерно так:

%%[ 

VAR @emailAddr, @p1_name, @p1_url, @p1_image
set @emailAddr = AttributeValue("emailaddr")

SET @p1_name = Lookup("Product_Recommendation", "Product_Name_1", "EmailAddress", @emailaddr)
SET @p1_url = Lookup("Product_Recommendation", "Product_URL_1", "EmailAddress", @emailaddr)
SET @p1_image = Lookup("Product_Recommendation", "Product_Image_1", "EmailAddress", @emailaddr)

]%%

В ваших функциях поиска вы пропустили запятую и двойные кавычки.

Если вам нужен еще поиск в AMPscriptпримеры, у меня есть куча здесь, в моем блоге

Ссылка :

...