[SalesForce] How to create interpersonal documents (PDF Files) and how to attach them into email using a SFTP server

In Marketing Cloud : I would like to create interpersonal documents (customer contract in PDF) and attach them into email in automation, (in the same time that I send my email scheduled in journey Builder) : using a SFTP server.

Could you please tell me how to do that?

Best Answer

PDF creation is not available inside SFMC, you would have to use a 3rd party platform to create those. Outside creating a complex custom script in a cloud page or script activity (high level of effort) which is likely still going to be inefficient and unreliable.

Once created though, you can push them to the FTP or host them on a web server and then use the AttachFile() AMPscript function to attach them to your emails.

Of note though is that AttachFile is not enabled by default and has a cost per email associated with it.

If you do not need them to be attached, you can import these files into Content Builder (through wizard or API) and then associate the external URLs of each item inside CB with a unique 'key' to differentiate each person (Recommend SubscriberKey) and put this into a DE.

You then do a lookup and create a dynamic link in your email that will take them to this file. This will then allow your recipient to either view the document in their browser or download it or both.

example of dynamic link AMPscript:

%%[
   set @Subscriberkey = AttributeValue("_SubscriberKey")
   set @fileURL = Lookup('myPDFde', 'URL', 'Subscriberkey', @Subscriberkey)
]%%

<a href="%%=RedirectTo(@fileURL)=%%" alias="PDFlink">Download your PDF here</a>
Related Topic