Dynamic PDF attachment

I’m new to emailing through workflow…I have a print context that generates individual PDF’s into a single folder, with each PDF named by a “RecipientNumber” field

12443.pdf
12345.pdf
etc
etc

So in workflow, I firstly, need to send an email, only if an email address exists in the “Email” field and secondly, if an email does exist, send the email template and dynamically attach the outputted PDF in the step above, based on the “RecipientNumber” field

RecipeintNumber = 12443
Email = tester@tester.com
Attachment = 12443.pdf

Is that possible through workflow?

It is indeed possible…

please read the following link on Email and attachment.

Basically, you have 2 ways:

  1. You generate your PDF (Create Print Content Connect plugin in Workflow), store it into a temp (or permanent) directory and attach it to an email (Workflow Send email plugin) or a HTML email (Create Email Content Connect plugin in Workflow)
  2. You generate an HTML email from Connect and check the option Print context as PDF attachment, in the Create Email Content Connect plugin in Workflow. This way, your PDF will be create on the fly and automatically attached to your email. If the email is not generated, because of a condition, then the PDF is not generated.

Great thanks, worked it out using the link you provided

Can you set a rule to not send the email if it doesn’t find a matching attachment in the above example?

Sorry for the delay, i am sure you found a way to do this but for new reader, here’s what you can do:

  1. Most likely you have a condition that prevent the creation of the PDF. Look for the same condition in your email.
  2. If you wan to be sure even in cases when a PDF should have been created but wasn’t for some unknown reason, you best bet would be to have the PDF created in a branch and then use the File/Folder Condition plugin in Workflow to chekc the existance of a PDF and pass that information to the Create Email Content plugin to determine if an email shold be sent.