Join Us!!! Ghost Members' Area and Newsletter Configuration

Connecting with your community through your Newsletter is a must if you want to grow your brand. Follow this guide to configure your Members' area and Newsletter in your Ghost Website.

Join Us!!! Ghost Members' Area and Newsletter Configuration
Image by Muhammad Ribkhan from Pixabay

You already open your House's doors to every people in the World. You are sharing valuable information and resources with them. Why don't you go a step forward and allow the most frequent visitors to become members of your club? They will have access to unique content and the chance to subscribe to your Newsletter and be up to date with what's happening in your Business.

In case you haven't created your Ghost Website yet, you will find a step-by-step guide in the following link:

Ghost Website creation in <You tell me> minutes
Are you eager to have your own Website but don’t know where to start?Are you overwhelmed with so much information?This article will guide you to build an amazing website from scratch using Self-Hosted Ghost.

To add the members' area and Newsletter functionalities to our website, we will follow these steps:

  • Mailgun account creation (not required for Ghost Pro)
  • Members' Area Configuration
  • Testing

Mailgun account creation

Ghost recommends using Mailgun as the mail provider. There are other alternatives, but they are more complex to implement. So let's go with this one.

Creating the account

Go to Mailgun and click on Get Started for Free button.

Fill in the fields, select the plan (in this case Foundation Trial), and click on Create Account button. You will receive an email for validation.

💡
Check the information on the Foundation Trial plan. When we create this article, it's free for 30 days if you send less than 5.000 emails. And it'll cost USD 35/month after that period. But Mailgun offers a Flex Plan, too. Refer to this article's "Downgrade your Mailgun account" section to move to the Flex plan.

Add your domain

Once you have created and validated the Mailgun account, you should add the domain for your website.

From the dashboard, click on Add a custom domain link.

Fill in the Domain name, select the Domain Region, and click on Add Domain button.

They recommend using a subdomain, which is unnecessary as we use Mailgun for sending only.

Verify the domain

Once you have added the domain, you must verify it (prove that you own it).

These are the 4 steps:

Go to your DNS provider

Go to your hosting administration console. In this case, it is cPanel, provided by Fastcomet hosting.

Scroll down to Domains and click on Zone Editor.

Click on Manage button in your domain row.

Add DNS records for sending

Two records need to be added (the TXT ones)

In your cPanel Zone Editor, click on Add Record button. Select the Type TXT and copy the information you received for Mailgun (the TTL will be already in place). Then click on Save Record.

Add DNS records for tracking

Perform the same activity for the tracking records:

Add it to your DNS

Wait for your domain to verify

Once the configurations are done, click on Verify DNS settings. It says that it may take up to 48 hours to verify (in my case, it took only 2).

Going to the Domains option on the left, you can see that your domain has a "?" meaning that it is not validated.

After a few hours, you will receive this email:

And you can check the same on the Mailgun website:

By clicking on <YOUR_DOMAIN>, you can see the server information you need to add to your Ghost instance.

In the next screen, you will see the credential needed for sending emails via SMTP and API (more about this in the next section). Copy both, as they will be required in the next steps for doing the configuration in Ghost.

This is for SMTP

You will see the server, port, and credentials. Write them down because you will need them in the next step.

Get the information for API, as well.

Configure Mailgun in Ghost

There are 2 different configurations for sending emails in Ghost. And we require both:

  • SMTP: Used for sending individual emails (new registrations and emails for accessing user accounts)
  • API: Used for sending massive emails (newsletter).

SMTP Configuration

With the Mailgun verified account, you can go to your Ghost configuration file, which is config.production.json (or config.development.json if you don't have the production one), and include the mail server information.

"mail": {
  "transport": "SMTP",
  "options": {
    "service": "Mailgun",
    "host": "smtp.mailgun.org", --(or "smtp.eu.mailgun.org")
    "port": 465,
    "secure": true,
    "auth": {
      "user": "postmaster@<YOUR_DOMAIN>",
      "pass": "<YOUR_PASSWORD>"
    }
  }
},
  • service: Mailgun
  • host: will depend on where you chose your servers will be located.
    US: smtp.mailgun.org
    Europe: smtp.eu.mailgun.org
  • port: It could be 25, 587, or 465. I tried using 587, but it didn't work. So tried the 465, and it worked.
  • secure: true.
  • auth (user & pass): the user and password obtained in the previous section of this guide.

If you don't have the credentials from the previous section, you can still get them by going to Sending > Domain settings > SMTP credentials in your Mailgun account. You won't see the password, so you need to Reset it if you don't have yours.

After changing the config.production.json file, you need to restart the Ghost instance so the changes take effect.

API Configuration

You will require the API to send bulk emails.

Get the API Private Key in Mailgun, by going to your account > API Keys

Then select the API security tab. Copy the Private API key

To include it in Ghost, go to Settings > Email newsletter. Enable the Newsletter sending, expand the Mailgun configuration, select your Mailgun region, domain, and paste the Private API key. You named the domain in this guide's "Add your domain" section.

Then Save.

You can configure how the email looks by clicking the Customize button.

Enable the members' area and test

To enable the Membership functionality, go to Settings > Membership. Set the Subscription access to Anyone can sign up, and Save.

Then Restart the Ghost Instance in cPanel.

Test the Sign up feature

For testing, go to your site. A Sign up option will appear. Fill your name and email address, and click on Sign up.

An email was sent to your account to confirm your signature.

When you click on the button, you will be redirected to the site and see this message:

You will see the new member in the Ghost Members Section

Test the Newsletter

So far, you have tested that the SMTP configuration and the members' area are working. But now you will test the Newsletter functionality.

For that, create a Post and publish it.

Select the option Email only, so it will not appear on your website.

And send!!

And that's it!!

Check your inbox. Your Newsletter is running!!!

Downgrade your Mailgun Account

If you are just starting with your Newsletter, you probably don't have any members yet. So there is no advantage to having a Foundation Plan and paying U$D 35/Month.

Mailgun has a Flex plan (pay as you go). It's hard to find, but I could downgrade mine after opening a support ticket. I waited for my trial to expire, but I think this was unnecessary. The flex plan has no fixed price, but you pay according to the number of emails you send (today, it's U$D 1 / 1.000 emails).

This is how you can change yours.

Go to Plan & Billing.

Select the cog icon. If you have a Downgrade option, click it. But if you don't, click on Unsubscribe.

Select Unsubscribe

And confirm the Downgrade.

You will see the confirmation screen.

Summary

If you reached this point, you already:

  • Created and configured a Mailgun Account
  • Verified DNS on Ghost
  • Configured your SMTP and API email sending
  • Added a Members' area to your website
  • Signed up a new member
  • Sent your first Newsletter

Sign up on my website and subscribe to the Newsletter to see how this works. You will receive fantastic content every week.