Answers.Body: <p>I don't think it's possible right now without coding.</p>
  
  <p>If you are not afraid of coding, what you could do is something like :</p>
  
  <ol>
  <li><p>add you membership certificate after the content of the receipt (in templates) and add an arbitrary separator between your receipt and the certificate. In my case <code>&lt;!--break--&gt;</code>.</p></li>
  <li><p>use the hook_civicrm_alterMailParams with the following content (extract the part after <code>&lt;!--break--&gt;</code> and put it in a pdf as a attachment) :</p>
  
  <pre><code>$pos = strpos($params['html'], '&lt;!--break--&gt;');
  if ($pos !== False) {
    $pdf_content = substr($params['html'], $pos + 12);
    $params['html'] = substr($params['html'], 0, $pos);
  
    if (empty($params['attachments'])) {
      $params['attachments'] = array();
    }
    $params['attachments'][] = CRM_Utils_Mail::appendPDF(ts('Membership certificate') . '.pdf', $pdf_content);
  }
  </code></pre></li>
  </ol>
  
  <p>I may create a little extension for this.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-31T17:27:54.870Z
Answers.Text: I might have to think of a different way around it then,
  
  I was contemplating issuing the receipt and then on a daily basis running a command to find all the new renewals and send them an e-mail with the certificate as an e-mail for them to print.
  
  It does not sound like it will work, but I will have a look because the certificate template is a single image, and then the membership details tokens overlaying it.....
Answers.UserDisplayName: Darren Whittenham-Gray
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-31T16:04:30.230Z
Answers.LastActivityDate: 2015-03-31T16:11:54.743Z
Answers.LastEditDate: 2015-03-31T16:11:54.743Z
Answers.UserDisplayName: samuelsov
Answers.Body: <p>This would be two steps as far as emailing it, but you could build the certificate as a "PDF Letter" template.  You might need to do some HTML and tokens, but no other coding.</p>
  
  <p>Every day, week, or month (whatever your schedule), you can search for new members (Memberships > Find Memberships).  From the results, pick the first, and in the Actions drop-down, select "Print PDF letters for memberships".  You can pick the certificate template you made (or you can create it on the spot with the first member), and it'll generate a PDF.  Save the PDF and attach it to an email to the member.  You can then repeat it member-by-member.</p>
  
  <p>It would be great to have an easy thing like Samuel describes, because that would be one step instead of two, but this would work in a pinch.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-31T19:48:17.740Z
Answers.LastActivityDate: 2015-03-31T19:48:17.740Z
Answers.UserDisplayName: Andie Hunt
Answers.Body: <p>If you do the work to produce an email with the certificate as an attachment then you can use a scheduled reminder to send the email a day or so after the member signs up or renews.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-03T07:34:49.487Z
Answers.Text: Hi Joe,  
  
  I did think of using scheduled reminders and using the message template of a full membership certificate as the body of the e-mail. If a member renews, will the renewal date be seen as the membership start date though as we try to renew these on an annual basis.
Answers.UserDisplayName: Darren Whittenham-Gray
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-03T22:50:36.330Z
Answers.Text: The start date for renewed membership is the day after the previous membership's end date. This is true both for fixed date membership types eg calendar year for eveyone, and for rolling period membership types, where the annual membership period starts whenever a person joins. This assumes it is a renewal done before end of membership or in grace period. If membership has expired then start date will be set the same as for a new membership.
Answers.UserDisplayName: Joe Murray
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-03T23:24:08.653Z
Answers.Text: Hi Joe.  Thanks for your assistance with this.  As we have a fixed period 1 April to 31 March, so I understand that if a membership is renewed before 31 March it will trigger on 1st April for "Join Date +1 Day" and if it was renewed on the 10th April it would trigger on the 11th.  Now (and sorry I am asking way too many questions) if an individual renews for an organisation, where does the certificate go? To the individuals e-mail or the organisations.
Answers.UserDisplayName: Darren Whittenham-Gray
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-02T23:18:39.120Z
Answers.LastActivityDate: 2015-04-02T23:18:39.120Z
Answers.UserDisplayName: Joe Murray
Body: <p>On Drupal 7.35 / Civi 4.4.14 - is it possible for a membership payment via CiviContribute to e-mail a membership certificate as a PDF as an attachment to a receipt?</p>
  
  <p>What we currently do is print membership certificates and post them, however the intention is to move to e-mailing them. I already have the template certificate stored as a mailing message template which comes out nicely when printed on A4.</p>
  
Tags: <civicontribute><pdf><civimember>
Title: How Can I Attach a PDF Certificate for a Membership Payment?
ThreadText: # How Can I Attach a PDF Certificate for a Membership Payment?
  
  (Asked by: username_0 on 2015-03-31)
  
  On Drupal 7.35 / Civi 4.4.14 - is it possible for a membership payment via CiviContribute to e-mail a membership certificate as a PDF as an attachment to a receipt?
  
  What we currently do is print membership certificates and post them, however the intention is to move to e-mailing them. I already have the template certificate stored as a mailing message template which comes out nicely when printed on A4.
  
  **Tags:** civicontribute, pdf, civimember
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2015-03-31. Score: 4
  
  I don't think it's possible right now without coding.
  
  If you are not afraid of coding, what you could do is something like :
  
  1. add you membership certificate after the content of the receipt (in templates) and add an arbitrary separator between your receipt and the certificate. In my case `<!--break-->`.
  2. use the hook\_civicrm\_alterMailParams with the following content (extract the part after `<!--break-->` and put it in a pdf as a attachment) :
  
     ```
     $pos = strpos($params['html'], '<!--break-->');
     if ($pos !== False) {
       $pdf_content = substr($params['html'], $pos + 12);
       $params['html'] = substr($params['html'], 0, $pos);
  
       if (empty($params['attachments'])) {
         $params['attachments'] = array();
       }
       $params['attachments'][] = CRM_Utils_Mail::appendPDF(ts('Membership certificate') . '.pdf', $pdf_content);
     }
  
     ```
  
  I may create a little extension for this.
  
  > **Comments:**
  > **username_0**: I might have to think of a different way around it then,  I was contemplating issuing the receipt and then on a daily basis running a command to find all the new renewals and send them an e-mail with the certificate as an e-mail for them to print.  It does not sound like it will work, but I will have a look because the certificate template is a single image, and then the membership details tokens overlaying it.....  
  
  ---
  
  ### Answer by username_2 on 2015-03-31. Score: 1
  
  This would be two steps as far as emailing it, but you could build the certificate as a "PDF Letter" template. You might need to do some HTML and tokens, but no other coding.
  
  Every day, week, or month (whatever your schedule), you can search for new members (Memberships > Find Memberships). From the results, pick the first, and in the Actions drop-down, select "Print PDF letters for memberships". You can pick the certificate template you made (or you can create it on the spot with the first member), and it'll generate a PDF. Save the PDF and attach it to an email to the member. You can then repeat it member-by-member.
  
  It would be great to have an easy thing like Samuel describes, because that would be one step instead of two, but this would work in a pinch.
  
  
  ---
  
  ### Answer by username_3 on 2015-04-02. Score: 0
  
  If you do the work to produce an email with the certificate as an attachment then you can use a scheduled reminder to send the email a day or so after the member signs up or renews.
  
  > **Comments:**
  > **username_0**: Hi Joe,    I did think of using scheduled reminders and using the message template of a full membership certificate as the body of the e-mail. If a member renews, will the renewal date be seen as the membership start date though as we try to renew these on an annual basis.  
  > **username_3**: The start date for renewed membership is the day after the previous membership's end date. This is true both for fixed date membership types eg calendar year for eveyone, and for rolling period membership types, where the annual membership period starts whenever a person joins. This assumes it is a renewal done before end of membership or in grace period. If membership has expired then start date will be set the same as for a new membership.  
  > **username_0**: Hi Joe.  Thanks for your assistance with this.  As we have a fixed period 1 April to 31 March, so I understand that if a membership is renewed before 31 March it will trigger on 1st April for "Join Date +1 Day" and if it was renewed on the 10th April it would trigger on the 11th.  Now (and sorry I am asking way too many questions) if an individual renews for an organisation, where does the certificate go? To the individuals e-mail or the organisations.  
  
  ---
  
  