0

How to call a cloud page from Email content without redirect to this landing page? This Code snippet is not working:

Code Snippet:

%%[
            VAR @parameter1
            SET @parameter1 = [EmailAttribute1]
            RedirectTo(CloudPagesURL(888, 'p1', v(@parameter1)))

   ]%%

Cloud Page:

    %%[     
       VAR @param          
       SET @param= RequestParameter('p1');
       /* treatment*/     
    ]%%

The call to the cloud page is working only if I display the link in the email and I click it.

<p><a title="MyPage" href="%%=RedirectTo(CloudPagesURL(888, 'p1', v(@parameter1)))=%%" alias="ThisAlias" conversion="false">Click here</a></p>

Best Regards,

4
  • 3
    What are you trying to do with this, what’s the purpose?
    – zuzannamj
    Jul 26 at 16:45
  • Are you looking to collect the ampscript from the cloudpage and run it in the email context? You might want to look at HTTPGet or similar functions. But be warned this is an API call and can slow down your emails significantly at volume and high frequency. Jul 27 at 12:58
  • @Gortonington The purpose is to upload a file encoded in base 64 into Content Builder and attach it to the email. So in the cloud page I used the API "asset/v1/content/assets" to upload the file and the ampscript function "AttachFile" to attach it. I chose to work with cloud page because within the content Builder the code is running many times (files uploaded and attached many times)
    – Sarah
    Jul 28 at 8:41
  • The issue will be replicated using the CP or in the email - the issue seems likely to be coming from the logic and the fact that the email is processed multiple times due to environment: (pre-process, HTML MIME type, Text MIME type) and that is without consideration of preview or test sends. You will likely need to handle that prior to being able to utilize this. I have not had this need before so I do not have a solution for you though. Jul 28 at 17:29

0

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.