Skip to content

fix pdf not generated even if skip send email for contacts with do not email

capo requested to merge capo/pdfapi:master into master

When calling Pdf.create with skip_send_email for a contact that has do_not_email an error message is returned:

Suppressed creating pdf letter for: {contact.display_name} because DO NOT EMAIL is set.

This is an example call:

$contactId = 1; // set here a contact with `do_not_email`
$templateId = 1; // set a random valid template here

civicrm_api3('Pdf', 'create', [
    'contact_id' => $contactId,
    'template_id' => $templateId,
    'skip_send_email' => false,
]);

Merge request reports

Loading