We're building an email template in Marketing Cloud Email Studio where we're passing the HTML content of the email dynamically as subscriber value.
The template looks simply like
Now, we're trying to add email attachments but trying to figure out best way to do this.
Adding an Ampscript block like below to the template works just fine:
%%[ var @fileName, @fileAlias set @fileName = "http://www.africau.edu/images/default/sample.pdf" set @fileAlias = "test.pdf" AttachFile('HTTP', @fileName,@fileAlias) ]%%
But we're looking at bit more dynamic control over the attachments and having ability to pass them dynamically to marketing cloud.
We've tried adding the ampscript block to the html code we're sending (email_contents_html subscriber attribute), but that just results in script rendered inline in the content and not executed.
Is there any way to accomplish what we're trying to achieve here, i.e. being able to pass Ampscript block to be executed in the email as part of subscriber attributes or something else from outside the marketing cloud?