How can i add a contact form to my blog without using external service?

I want to add a contact form to my blog. I found a few guides but all of them uses an external service for that purpose. I want to do this locally at my vps. I am novice to web programming and javascript, if you give some hints that would be very helpful for me.

1 Like

No way to do it locally, you would need to use an external svc :slight_smile:

While I agree the beauty of Ghost lies in its simplicity, and preventing “feature creep” appears to be one of the main goals of the developers (I applaud the lightweight and direct writing nature of Ghost which is why I switched from WordPress), I think having a built-in contact form vs utilizing a third party service would be an asset for many bloggers.

John, is it possible to move this one over to the feature requests section and I will add my vote to it?

Not going to move this one over, as it really is help request and I don’t want to totally edit OP’s words to be something different. You’re more than welcome to open a new topic for an idea/request around this, but it’s worth really thinking through the feature and defining what it means - because a lot of people say they want a “contact form” but if you ask 5 people what that means, you’ll generally get 5 different answers.

If it was a simple feature which was standard to everyone then we probably would’ve done it already, but once you dig in you start to find the nuances very quickly. Eg.

What fields are there? How will you validate the input given that everyone will want different fields? What page will people go to after the form has been submitted? How will you be notified about new entries? How do you prevent spam? Nope that definitely won’t work, seriously how do you prevent spam? What about people who want more than this?

Ok so now the whole thing very quickly jumps from “one small feature” to - oh, it turns out this is so complex you could literally build an entire company around this feature and sell it as a product.

Oh it turns out that’s exactly what TypeForm did… and it works really well?

Phew. This is a lot of work tbh and we have absolutely no spare resources or time. Maybe we should use Typeform?

if you ask 5 people what that means, you’ll generally get 5 different answers.

To be fair, I think most bloggers more or less want the same thing which is to have their followers be able to reach them easily without providing a direct email address (to prevent spam, etc).

What fields are there?

I wouldn’t go so far as to create a plugin-like experience, but Name, email and a comment box is usually good enough for a blog. I think that would create a great experience for the majority of bloggers.

What page will people go to after the form has been submitted?

A modal would probably be fine. I think that’s how Ghost handles the Subscriber form now, no?

How will you be notified about new entries?

It’s an email contact form. I don’t think extra notification is needed since you’re getting emails.

How do you prevent spam?

Google reCAPTHCA, a feature that I think was also requested for the Ghost Subscriber form.

What about people who want more than this?

I don’t think it’s necessary to cater to every use-case. Ghost does what it does extremely well; again I think a very simple form (Name, email, and a message box) should be more than sufficient to cover the majority of use-cases and you can still send people to a 3rd-party if they’re asking for more features.

You might be surprised then :)

I think this contact form feature makes a lot of sense, but I do agree that it can become quite complex once everyone pitches in and asks for more features and functionalities. I personally do consider contact forms to be a core feature of any CMS, but I can also fully understand the desire for simplicity.

However, I think that Ghost already has the basic components in place to bring in a very simple contact form:

  • subscribers (it already collects emails)
  • email (it can send notification emails)

Could just create another function additional to subscribe, such as contact, for example, which would function just like subscribe, but would add another data point: the message. Thus, this contact could just be a subscription in which the subscriber also leaves a message and which gets saved in the subscribers list (no email delivered, at least until the anti-spam feature is not in) in the following form:

  • email
  • message
  • subscription date
  • status

A simple anti-spam feature could be added via the Google ReCaptcha API (should not be that complicated and should most probably satisfy the requirements of 80% of the users).

Just my 2 cents. :slight_smile:

Otherwise, one could just go to a third party service like TypeForm or JotForm or whatever else, create a form and copy/paste the script in a page (which I did for my Ghost blog, using JotForm).

Cheers!

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.