1. Home
  2. Knowledge Base
  3. Document Library Pro
  4. Advanced Usage

How to email subscribers when a new document is added

Some website owners like to email their subscribers when a new document is added to their document library. This article describes two methods for how to do this on sites that use the Document Library Pro plugin:

  • Method 1 - Using the MailOptin plugin to email subscribers when a new document is added
  • Method 2 - Using your email platform to email subscribers when a new document appears on your RSS feed

Method 1 - Using the MailOptin plugin

MailOptin is an automated email marketing plugin whicih allows you to notify WordPress users and email subscribers whenever you publish a new post. It can also send a daily, weekly, and monthly roundup or email digest of published posts. It works with all the major email marketing software and CRM platforms, including Mailchimp, Campaign Monitor, Sendy, Constant Contact, AWeber, ConvertKit, MailerLite, GetResponse, Klaviyo, ActiveCampaign, Brevo, SendGrid, Mailjet, Keap, Zoho Campaigns, CleverReach, iContact, Mailgun, E-goi.

Since Document Library Pro documents are a post type in WordPress, you can equally use MailOptin to notify people of new documents.

Follow these instructions to create an automated email workflow to notifies your website users and/or email subscribers whenever a new document is added.

  1. First, install and activate the MailOptin plugin on your WordPress site.
  2. If you are going to notify email subscribers in your email marketing software instead of your WordPress users, you need to connect MailOptin to your account. For this article, we will be connecting to Mailchimp but the process is similar for other email platforms.
  3. Go to MailOptin → Integrations → MailChimp Connection, enter your MailChimp API key, and save the setting.
  4. Next, go to MailOptin → Emails → Add New → Email Automation.
  5. Enter a title for the automation and select an email template.
  6. Customize the email to your heart's content. The most important part is the Settings panel:
    • Ensure “Document” is selected as the Custom Post Type.
    • MailOptin also includes settings to restrict emails to only go out for documents belonging to specific categories, tags, or file types.
  7. The last step is to specify who to notify whenever a new document is added. To do this, scroll down to the 'Recipient' section. Recipients can be your WordPress users further filtered or restricted to specific roles such as Author, Contributor, Subscriber, Editor, or a combination of roles depending on who you’re trying to reach.
  8. If you want the recipients of the email to be all WooCommerce customers, select 'Registered Users' as the connection and 'Customer' as the user role.
  9. To send the email notification to your list subscribers, select your email marketing service (Mailchimp in this example) as the connection and then your email list.
  10. When you are done, click the ‘Save Changes’ button at the top right corner and then toggle the activation switch to the right to enable the automation.

If you instead want to send a daily, weekly, or monthly roundup of newly added documents, see the documentation on setting up email digests.

Method 2 - Using your email platform with RSS feeds

In WordPress, all posts can be assigned to categories - also known as custom taxonomies. Every category/taxonomy has a unique RSS feed which you can use to send emails to your mailing list whenever a new item is added to it.

Document Library Pro has a document-category taxonomy, which works like any other taxonomy in WordPress. This means that you can use its RSS feed to automatically notify subscribers when new documents are added to each category.

  1. Use the Document Library Pro plugin to create one or more categories which you will email subscribers about when a new document is added. Some tips:
    • If you want to email all your subscribers regardless of which category the document was added to, then you should create a main top level category called ‘Documents’ and use the RSS feed for this category. You can then add as many sub-categories as you like. Documents added to the sub-categories will be included in the RSS feed for the main parent category
    • If you want to email different document categories to different groups of subscribers, then you don’t need to create a top level category. Instead, simply create as many categories as you like and use the RSS feed URL for each one as needed.
  2. Next, get the RSS feed for the category (or categories) that you wish to send emails for. To do this, simply add /feed to the end of the category URl, e.g. https://documentlibrary.barn2.com/document-category/accounting/feed/ is the RSS feed for one of the categories on our plugin demo site. ​
  3. Now you need to use your chosen email platform to create an RSS-driven email which will automatically send an email to your mailing list (or a specific segment of it, if you prefer) whenever a new document is added to the relevant category. For example, if you use Mailchimp then they have provided instructions on how to create RSS emails in Mailchimp. Most mailing list providers will have similar features - just Google the name of your mailing list platform + “RSS” and you should find the instructions.

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.