Application / Business & Account Settings

PDFs from Emails

Scrape PDFs from Emails

To extract templates, PDF attachments, and credit memo PDFs within the emails, set up the PDFs from Emails functionality in YayPay. 

We recommend using a different mailbox for extracting PDF attachments instead of your standard AR mailbox. This will allow you to separate your end-customers' emails from the emails that contain the invoice template PDFs, or credit memo PDF as attachments.

YayPay connects to the mailbox every 10 minutes and extracts the invoice PDF attachment from new emails received today or within the last 3 days if the PDF Scrape - Scrape PDFs for last 3 days setting is enabled. These PDFs are then linked to the invoice records (or credit memos) obtained from the ERP. The email subject line must follow a prescribed format, which will be explained later (in step number 5).


1) Go to Settings | PDFs from Emails.

2) Check the Scrape Invoice and Credit Memo PDFs from Emails check box.

3) Enter the required details. Obtain them from your internal IT department or infrastructure team.

  • Protocol - Choose one: IMAP or IMAPS.
    IMAPS is the recommended option, especially for Gmail.
  • Host - e.g. imap.gmail.com or outlook.office365.com
  • Port - e.g. 143 or 993
  • Username/Password -  Obtain the credentials from your internal IT department (this is the same user credentials to log into the mailbox directly).
  • Load period (months) - Enter"12".
  • Sender email - Filter received emails and pull files received only from a particular email address.
  • Use TLS - Optionally, set this as specified by your IT department, infrastructure team, or e-mail service provider.
  • Inbox Folder (Inbox by Default) - see the Using Subfolders (in your designated PDF email Inbox) section.
  • Do not use customer ID -  Optionally, enable this if invoice PDF files are sent in an email to this inbox where the subject line is not expected to contain the customer ID (see illustration below).

4) Click Save and test connection to test and validate that YayPay has an established connection with this email inbox. A successful message will appear when a connection is made.

5) Ensure email subjects follow these patterns for the PDFs to be scraped:

  • For an email with an invoice PDF attached - Use the following email subject pattern:
    • Pattern:
      Customer id:'CustomerId', Invoice Number:'InvoiceNumber'
      To ensure accurate extraction, use the following values in the email subject pattern:
      CustomerId – A unique customer ID from your ERP system.
      InvoiceNumber – The number of the invoice to be scraped.
    • Example:
      Customer id:'001C000001RUK2IlAH', Invoice Number:'INV006843'

As a result, YayPay extracts the invoice PDF attachment, ensuring that the invoice record within YayPay maintains the same visual appearance as the original PDF.


  • For an email with a credit memo attached - Use the following email subject pattern:
Customer id: 'customerid', Reference Num: 'refnum' Credit Memo

Pay attention to the 'Credit Memo' keyword at the end of the pattern. It is a case-sensitive flag that signals a credit memo should be extracted.

The scraped credit memo PDFs are displayed in the Open Credits tab of the Statement page:

Using Subfolders (in your designated PDF email Inbox)

This section is only relevant if you choose to use a subfolder within the mailbox, which needs to be configured in YayPay.

These are the 2 additional steps required if you use a subfolder, instead of the Inbox as the default folder:

  • first, you have to create a named subfolder (e.g. YayPay Invoice PDF) under the main Inbox
  • also, you must set up a new email rule/filter in Outlook or Gmail to move all sent emails into the subfolder

If you use Outlook and use a subfolder, the Inbox Folder should be configured as follows:

If you use Gmail and use labels to label the emails sent from Intacct (e.g. Accounting is the first label followed by YayPay Invoice PDF), the Inbox Folder should be configured as follows:

 

Check if the “PDFs from Emails” setup was successful

The outcome of the setup described above can be checked as follows.

for invoices:

  • Choose one of the recently created open invoices from the Statement page or Invoices page
  • Click its reference number
  • You should see your version of the Invoice Template/PDF open up on a new page, instead of YayPay's generic layout. If you don’t, ensure that the checkbox in your Business Settings page (Settings > Business) called "Invoice Page – Embed Invoice PDF" is enabled (also, refer to this article)
  • The ability to view your Invoice Template/PDF in YayPay indicates that YayPay is successfully connected to the PDF mailbox, and can extract the corresponding Invoice Template/PDF sent as an email attachment
     

for credit memos:

  • Select a credit memo record from the OPEN CREDITS tab of the Statement page
  • Click its reference number
  • You should see the credit memo PDF open up on a new page

 

Additional info

Can't find what you need?

Contact our support team support@yaypay.com for help.