To extract templates, PDF attachments, and credit memo PDFs from emails, set up the PDFs from Emails functionality in YayPay.
We recommend using a different mailbox for receiving and 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.
Scrape PDFs from Emails
To scrape templates, PDF attachments, and credit memo PDFs from emails, YayPay connects to the PDF mailbox every 10 minutes. It checks new emails received 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) synced from the ERP. The email subject line must follow a prescribed format, which will be explained later (in step number 5).
To extract PDF attachments from emails:
Go to Settings | PDFs from Emails.
- Check the Scrape Invoice and Credit Memo PDFs from Emails check box.
- Select one of the available protocols and enter the required information. For a description of the options, see the Configuring Connection Settings section.
Obtain this information from your internal IT department or infrastructure team.
-
Click TEST CONNECTION AND SAVE to test and validate that YayPay has an established connection with this email inbox. A successful message will appear when a connection is made.
Alternatively, click on SAVE CHANGES to save the configuration without validating the connection settings. This is useful, for example, if you are sure the new settings are correct but the client will start using them later.
- 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: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'
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 on the Open Credits tab of the Statement page:
Configuring Connection Settings
This section describes the connection settings required when connecting to your PDF mailbox using one of the selected protocols.
The following options are available:
Protocol
Selects one of the available protocols:
Based on the selection, relevant options will be displayed below.
IMAP Protocol
This section describes configuration options available for the imap protocol. This protocol is used by email clients to retrieve messages from an email server.
For this protocol, the following options are available:
Host
Specifies the address of the host.
For example, imap.gmail.com or outlook.office365.com.
Port
Specifies the required port number.
For example, 143 or 993.
Username / Password
Specifies the credentials to your PDF mailbox.
Obtain the credentials from your internal IT department. This is the same user credentials to log into the mailbox directly.
Load Period
Specifies the time frame for which emails will be synchronized from your PDF mailbox.
For example, if you set this option to 3, up to 3 months old emails will be synced. If set to 0, no emails from your PDF mailbox will be synced.
We recommend entering 12.
This field becomes uneditable once saved.
Sender Email
Filters received emails and pull files received only from a particular email address.
Inbox Folder
Specifies the Inbox folder.
For more details, see the Using Subfolders (in your designated PDF email Inbox) section.
Use TLS
Defines whether or not the TLS protocol will be used.
Set this as specified by your IT department Infrastructure team or e-mail service provider. This is an optional security setting.
Do not use Customer ID
Check this option if you expect to receive invoice PDF files without customer IDs in the email subject line.
IMAPS Protocol
This section describes configuration options available for the imaps protocol. This protocol is a secure version of the IMAP protocol as it uses SSL/TLS encryption to protect email traffic.
Options available for this protocol are the same as those available for the imap protocol.
Outlook 365 Protocol
This section describes configuration options available for the Outlook 365 protocol. This is a Microsoft service that provides mail hosting with the use of Microsoft's Outlook application.
For this protocol, the following options are available:
CONNECT TO MICROSOFT ACCOUNT
Opens a Microsoft web page that will guide you through the process of connecting to your Outlook 365 account.
Shared Mailbox
Specifies the email address of the shared mailbox from which you want to sync PDF files.
Inbox Folder
Specifies the name of the mailbox folder that you want sync PDF files from. For example, Inbox.
For more details, see the Using Subfolders (in your designated PDF email Inbox) section.
Do not use Customer ID
Check this option if you expect to receive invoice PDF files without customer IDs in the email subject line.
Gmail Protocol
This section describes configuration options available for the Outlook 365 protocol. This is an email service provided by Google.
For this protocol, the following options are available:
CONNECT TO GMAIL ACCOUNT
Opens a Google web page that will guide you through the process of connecting to your Gmail account.
Inbox Folder
Specifies the name of the mailbox folder that you want sync PDF files from. For example, Inbox.
For more details, see the Using Subfolders (in your designated PDF email Inbox) section.
Do not use Customer ID
Check this option if you expect to receive invoice PDF files without customer IDs in the email subject line.
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