0

I want to pull in the view as webpage url from the Sendlog, but it looks like my lookup does not return any results. This is a code snippet from my email:

var @vawp, @subID, @jobID, @batchID
set @subID = AttributeValue("subscriberid")
set @jobID = AttributeValue("jobid")
set @batchID = AttributeValue("_JobSubscriberBatchID")

set @vawp = LookUp('SENDLOG_DE', 'view_email_url', 'SubID', @subID, 'JobID', @jobID)

When I do a LookupRows() on this SendlogDE, it does return rows. There is data in my sendlogDE, with correct subscriberdID and jobID.

Even when I do LookupRows() -> Row() --> Field() , it does not return a value.

This is my html

<a href="%%=RedirectTo(@vawp)=%%" alias="VAWP" target="_blank">View email in browser</a>

And I get the following error when I click the link (ofcourse the link is probably empty but gets url-proofpointed).

We cannot direct you to the requested web page at this time. Please try again.

I want to get the vawp url from the sendlog, because the journey builder campaign overwrites the sendable DE every day using a sql query. This is why the out of the box vawp url doesn't work. According to documentation, I should be able to get the url from the sendlog, but the lookup doesn't return data. The URL in the sendlog is the one I need because this url does not break.

Is there something that I'm missing?

Thanks

  • 1
    Why would you need this? There is a standard functionality to display the view as web page link inside marketing cloud. Do you want to display some of the last emails for this subscriber or whats the purpose behind it? – Johannes Schapdick Jun 3 at 15:49
  • @JohannesSchapdick We use the view_email_url in the send log for a variety of purposes. One of the most useful is to build a wrapper around the send log table that allows business leaders to search the send the log with a simple form and view the emails as they were deployed to a user in the past. Very helpful with legal issues that may come up with some orgs related to a specific user/email. – Jason Hanshaw Jun 3 at 17:11
  • 1
    If you send via normal send processes and don’t leave the sending data extension intact you will most likely not see the email like it was. This is especially true when you use dynamic content blocks. Overwrites, updates or deletes that change the dataextension will make the email show the default content of those blocks. Therefore these links won’t actually be what you want (I believe). If you really badly want to do that you need to store the html of the emails with ampscript functionality inside other dataextensions. The vawp will most likely not withstand gainst law aspects. – Johannes Schapdick Jun 3 at 17:55
  • 1
    @stuart, I'm still not sure I understand the use case. Is this AMPScript executing in a landing page or is it running as an email sends that gets the VAWP URL from a previously sent email? – Macca Jun 4 at 7:38
  • 1
    @JohannesSchapdick is likely right. If your sendable DE has been overwritten and that record no longer exists in it, then it will break the VAWP link and will show you the error you are seeing. There are a few ways to work around this, but without more info on use case and existing data set up, we can't really help much more. – Gortonington Jun 4 at 12:13
1

I would print the VAWP to the screen for the send where you are experiencing this error, and then input that URL manually into the browser to confirm that page loads at all and doesn't return the error you are describing.

If the data that the email's logic contained has been modified after the send (i.e. DE's being used as a lookup in the email have been renamed/updated or had field names/data-types changed etc...) then the email cannot be rendered as a VAWP since it doesn't contain the necessary data to validate. I've also seen this happening as a general system error, which makes it frustrating to debug.

At first glance, your ampscript looks fine to me so I'm guessing it's related to the VAWP itself and not your pulling it into the email.

  • Thanks for your reply. I have outputted the variables I need to do the lookup, and they appear the populate correctly. SubscriberID, JobID etc are all right, and stored in the sendlog. But using these variables, the lookup doesnt return the vawp from the sendlog, so i cant output this to the screen. When I manually copy/paste the url from the sendlog into my browser, the page loads fine. – Stuart Jun 5 at 7:17

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.