MM 2.4.0+ and PHP 7.1+ Required




PDF is a popular document format that provides a consistent display experience on many platforms. We have created an open-source plugin for MemberMouse that sends receipts to your members in PDF format, allowing them to more easily retain copies for their records. 


This plugin allows you to draft a billing receipt email with PDF attachment that is sent to members when initial and rebill payments are received. You can customize the Header and Footer(s) on the attached PDF. You can also allow your members to add custom billing details to the receipt and choose to ‘cc’ an additional recipient. There is functionality to resend a previous receipt and translation support. You'll find documentation for all these elements in this article.


Plugin Requirements


MemberMouse 2.4.0 or greater is required to utilize this extension. You can find your version in the bottom left corner of the MemberMouse Dashboard. To upgrade to the newest version, please visit Updates in the WordPress Dashboard, or follow our instructions for Manually Upgrading MemberMouse. We always encourage our customers to perform a full backup before adding, removing, or updating any component of their WordPress sites.


There are some additional server software components that are required for the plugin as well.  If you find that other site emails (like welcome emails) are being received, but pdf receipts are not, (after checking the SPAM folder) ask your host to verify that the following versions/extensions are active on your server. 

  • PHP 7.1+ is required. On sites with WordPress 5.0+ you can find your PHP version in Tools > Site Health, in the Server section. Customers using WordPress 4.x will need to install the Health Check Plugin to use this feature.  The plugin features also require 
  • PHP dom
  • Mbstring
  • GD
  • Either Imagick or Gmagick is also recommended



Installing the Plugin


  1. Download the latest version of MemberMouse PDF Receipts
  2. Open your WordPress Administrative Panel
  3. In the left column, select Plugins > Add New
  4. Click the Upload Plugin button at the top of the screen
  5. Click Choose File and select the file you downloaded
  6. Click Install Now
  7. When installation is complete, click Activate



Applying the Default Configuration


When activated, MemberMouse PDF Receipts does not immediately begin to send your receipts. You must first configure the extension for it to begin working. You can access the configuration panel by clicking Configure in the list of plugins on your site, or by selecting MM PDF Receipts in the left-hand column.


There are two sections, PDF Configuration and Email Template. Default settings are included for both, and you can pre-fill the configuration fields by clicking the Set the Default... links at the top of each section. You can then modify the section as desired, but note that you will need to click the Save button at the bottom of the section to apply your changes. 


Alternatively, you can activate the extension immediately with the defaults by clicking each of the Use the Default... links in the header:



Each link simultaneously applies and saves the defaults for its section. Once the configuration has been applied, the extension becomes active and will immediately begin to send receipts in response to both initial payment and rebill events.



Configuring the PDF File


This section allows you to customize some of the content in the generated PDF file. Basic HTML is supported. 



Business Information


The Business Information fields are where you would place your company's business details. These will be centered and displayed at the top of the PDF file, and the automatically generated receipt is placed in underneath. Note that HTML <br/> tags are required after each line of a multi-line address. 


Business Tax Label and Business Tax ID are optional fields that will only appear if entered.





Design Settings


The Design Settings section allows you to add a logo or image to the top of the PDF attachment. This will be located above the Business Information you filled out in the previous section. 


In the Header Logo/Image area, you'll generate a Data URI for your logo and paste it into the field provided. 


In order to do that, click on the link for Generate a Data URI (https://ezgif.com/image-to-datauri) and follow the simple steps provided to create the Data URI. 


1. Click 'Choose File' to locate the image you want to upload, and then select 'Upload'.

2. After uploading, select 'Nothing' from the Include Tags for dropdown menu and click on 'Generate Data URI'.

3. Click 'Select All' to select all the text in the 'Output Data URI code' box. Copy that text.

4. Go back to the PDF Receipts Plugin interface, and paste the code in the field provided.

If after previewing the image, you want to resize it. This same site can be used to resize: https://ezgif.com/resize

 


The Header Logo/Image Alignment allows you to choose the placement of the logo.


The Border Color will allow you to choose the color of the line that separates the logo image from the Business Information in the Header section. If you do not want a line to appear, you can choose White (#ffffff) as the color. 





Invoice Footer


The Invoice Footer consists of two areas. If these areas are empty, then that area of the receipt will be left blank.


Area 1 appears immediately underneath the invoice, and by default is aligned to the left side of the document, like a normal paragraph. It is useful for contact information, disclaimers, statements about billing, and so forth. 


Area 2 is centered, and displayed at the bottom of the document. It is useful for a final sign-off or tag line. 





Custom Billing Details


The Manually Entered Billing Details is an optional section that you would use to include a member's custom billing details in the 'Bill To' area of the receipt. 


The standard information that is displayed is Name, Email and Billing Address (if included). However, it may be desirable to display alternative or additional information, such as, if your members need to include a VAT or Tax ID with their billing details.




In order to use this section, you'll first need to have a space where your members can add that custom information. This is done through MemberMouse Custom Fields. You can create a 'Long Text' custom field and choose the option to 'Show on the My Account page' to collect this information. 


Then, if you select that Custom Field in the drop-down menu in this section, the extension will use this information on the receipt in place of the Name, Email, and Billing Address from the order. 


So it will need to be clear to your members that they must include all their information in the Custom Field, just as they'd like it displayed on their receipt.


When you have customized the template to your liking, click Save PDF Configuration


The default settings will generate the following content:






Configuring the Email Template


Your PDF invoice will be sent as an email attachment, and in this section, you can design the email to which the extension will attach the file. If you have previously created an email Push Notification, you will find this process familiar. HTML is supported. For ease of composition, new-line characters are automatically translated into HTML line-breaks. 



"From" address


The From drop-down allows you to set the email address that the email will be sent from. You can choose from any of your Employee Accounts, and if you'd like the email to come from an address that is not listed, you can click Manage Employees and Create an Employee Account.





"CC" address


The 'CC' area is an optional section that allows you to add a cc'd recipient for the receipt email. If this is not configured or if there is no 'cc' information available for the account, then the email receipt will be sent only to the email address associated with the member account.




In order to use this section, you'll need to create a 'Short Text' custom field to hold the additional email address information. Then, select that Custom Field in the drop-down menu in this section.


You can then choose to add this directly on your site, such as on the My Account page, so that your members can add the information themselves. Or you can simply add the information manually on an as needed, individual basis by going to the Member Details > Custom Fields tab.



Subject line and email text


In the next two sections, you can compose the subject line and body of the email. By default, our Order Receipt template is pre-filled. Note the use of SmartTags to dynamically insert information about the member and the order.





 When you are satisfied with the email, click Save Email Template


The default settings will generate an email that looks like this:






Using SmartTags in the Email Template


A variety of SmartTags are supported for dynamic content:


Content Link
Core Page Link
Member Link
Purchase Link
Content Data
Custom Field Data
Employee Data
Member Data
Order Data
Access Decision
Member Decision
Order Decision


When MemberMouse sends the email, Link and Data SmartTags are automatically replaced with information appropriate for your site, or for the recipient member. 


You can surround sections of your email with Decision SmartTags to control whether or not the content within will be sent. 


Note that the Content Link, Content Data, and Access Decision SmartTags require you to provide the ID of a particular page or post.




Testing the Extension


Once you've configured the PDF Content and Email Template, you'll notice that the header changes to indicate that the extension is active and displays additional tabs - Send Test, Resend Receipt, Info and Help.




It's recommended that you preview the results by sending yourself a test invoice. You can do this by going to the Send Test tab and entering your email address in the input field. Then click Send Test




The information to create the test email and pdf is taken from the most recent order placed.


Emails are sent using standard WordPress functionality, so if the message is not received, or ends up in your spam folder, it's typically due to issues with the email services offered by your hosting provider. Please see our article on Emails Not Being Sent for more information, and consider installing a third-party plugin to improve email deliverability.




Resend a Receipt


Periodically you may get a request from a member to send another copy of a past receipt. This section allows you to search their past order history and send a receipt for any past transaction. 




In the interface, you'll enter in the Order Number associated with the transaction that needs a duplicate receipt sent. 

If you do not know the Order Number, clicking on the 'Lookup Order #' button will open up the Browse Transactions screen so that you can locate that number.


Once you've entered the Order Number, click on Preview to confirm the information that's being sent and to whom.




The preview will show the Recipient Information, allow you to enter an additional 'cc' email address and display the basic Order Information. Once you're sure this is the correct transaction for the receipt you want to send, click on Confirm & Send Receipt.


When you resend a receipt, it will get logged in the Activity Log for the associated member, just as a regular receipt being sent is logged.




Support for Translating PDF Receipt Elements


The MemberMouse PDF Receipts plugin comes with default translation support for the following languages : 

German, French, Hungarian, Spanish, Mexican Spanish and Brazilian Portuguese


This means that if you have one of these languages selected in the WordPress General Settings > Site Language setting, then the headers on the PDFs that you send out (such as 'Date Paid' and 'Order Number') will be translated into that language.


If you want to alter these standard translations, would like to change the text on the headers, or translate them into a different language, then you would follow the steps listed in the Translate MemberMouse - Basic article. The only difference would be that when you are choosing the plugin to alter, you would choose 'MemberMouse PDF Receipts' and not 'MemberMouse'.