I am having trouble using CiviRules to send PDFs automatically using PDF API for CiviCR. Namely, when I create condition and I need to add action Send PDF there is to email parameter. I want this to be created dynamically like send Email action picks up email from contact automatically.

When I leave it blank the email doesn't go through.

[info] Civirules api action exception: Mandatory key(s) missing from params array: to_email. API call: Pdf.create with params: to_email="", template_id="74", contact_id="752"

I can't insert a token into that field. So, am I missing something obvious or is this functionality intended for a totally different purpose?

  • Since this question is about an extension, you may want to communicate with the extension authors by creating an issue at github.com/CiviCooP/org.civicoop.pdfapi/issues Commented Sep 26, 2018 at 21:54
  • I hoped to do some coding and make a PR myself, but I never seem to have the time to do that. I should create an issue either way. Thanks for the suggestion, Noah!
    – Marko
    Commented Sep 27, 2018 at 7:44

1 Answer 1


I ended up hardcoding it so it uses $contact['email'] instead of $params['to_email']

I am leaving it open for some time, if anybody has a better idea (or if I missed something obvious)


The developers of the extension included this feature. Using version 2.0 the PDF will be emailed to the associated contact if the to email field is left empty. So no need for hacks anymore. Big thanks to ErikH - CiviCooP

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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