I create an ampscript to retrieve some basic information based on Synchronised DE, because I want to send to a Salesforce campaign and Salesforce Report.

Here is the ampscript:

Set @FirstName = Lookup("Contact_Salesforce","FirstName","Id",_subscriberkey)

Set @LastName = Lookup("Contact_Salesforce","LastName","Id",_subscriberkey)

I tested the ampscript and it appears that if the contact is not in All Subscribers, the personalization is "empty" (no first name, last name displayed in the email), because he has not yet a SubscriberKey I guess. Actually, it is a new SFMC platform we are currently building, so there haven't been any massive sends for the moment.

How can I handle this? Can I replace in the ampscript "_subscriberkey" by something else or another information automatically wrapped in the SFMC URL that can identify the contact?

Actually I made some send tests to Salesforce report and campaign, I didn't receive any email. I opened a case with SFMC Support, they told me that it is because there are errors on my email. So I guess it is liked with personalization and AMPscript.

  • In the code you share you just SET the variable @FirstName. Please also share the part where you actually 'print' the content. The subscriber key automatically populates during send time. At that time the subscriber also gets added to the all subscribers list. So that might not be the problem. – DonL Jul 10 '19 at 13:18
  • OK so you mean that even if the contact is not yet in All subscribers (and has no SubscriberKey yet), at the time of send he will be added to All Subscribers and he will get at the same time a SubscriberKey, so that the personalization based on SubscriberKey would work ? Here is inside the HTML how i "print" the content : %%=v(@FirstName)=%% %%=v(@LastName)=%% -Actually, it seems to be OK in Preview & Test but only with the ones that are already in All Subscribers. – Ludivine L Jul 10 '19 at 13:51
  • @DonL finally, I suppressed all the ampscript and personalization element and the send worked this time on Salesforce Report and Campaign... So I guess the problem was effectively on the email but I don't understand why there was some error in the email... and it is a shame we can not Preview and Test the email directly with contacts on a salesforce Campaign or Reports before the send. – Ludivine L Jul 10 '19 at 22:15
  • Thank you for your help. Finally I managed to send to Report and Campaign, and the problem was indeed inside the ampscript. Again, it is a shame we can not Preview and Test the email directly with contacts on a salesforce Campaign or Reports before the send, I guess it often happens that there are errors on personalization that block the email send, but we can't easily see it before. – Ludivine L Jul 11 '19 at 9:08
  • When it comes to Personalization and you send to Reports, first send a mail to a Test report with the same fields but without Personalization. During send, SF creates a data extension automatically. Just look for it in your Data Extension folders. The attributes listed there will be the strings you need for Personalization. Hope this helps in the future. – DonL Jul 11 '19 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.