Coder Social home page Coder Social logo

konung / comfy_imprint Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 10.0 348 KB

Distributed as a gem, relies on SimpleForm, while this is an engine, it's inteded for use with Comfortable Mexican Sofa, and it may work with other Rails apps, but is not tested for them. Why not comfy_contact - cause keeping track of ComfyContact::Contact.contact - hurts my head.

License: MIT License

Ruby 82.21% JavaScript 2.39% CSS 3.90% HTML 11.50%

comfy_imprint's Introduction

#ComfyImprint This is what is commonly known as a "Contact Us" page, done as a mountable Rails 3 engine. It's designed to be used in conjunction with Comfortable Mexican Sofa Content Management System ( CMS CMS :-) ) I highly suggest to check out CMS as it runs circles around all other Rails CMS systems out there.

##Demo I don't like heroku, so there is no obligatory heroku demo, thou I might put up one later at some other provider. However you can see this gem in action on my personal blog at: http://www.gorbikoff.com/contact-us

##Features / Bugs

  • Uses your DB as a storage (creates comfy_imprint_contacts table) for all contact attempts on your website. Really convenient if you want to find that one person who emailed you from your website about buying it for $1000000 and you accidentally deleted that email. Also can be used to send notifications to your users. (There is an opt-in / opt-out Boolean field to let users sign up for your SPAM.) Major plus of this approach is that email is not 100% reliable: it can get lost, servers go down, mailboxes get filled, and SPAM filters go crazy. This takes care of it by saving at least something in your DB.
  • Several default fields that should be sufficient in 90% of use cases. Remember this should be an EASY contact-us form, not a credit application.
  • Built in validations / error checking for all fields ( phone, email, name, body, url, company name, is_subscribed). Has default error messages.
  • Default Placeholders (May the force be with you!).
  • Easily customizable to work with your CSS framework. Used in production on sites with both Bootstrap and Zurb Foundation.
  • I18n ready. Right now has English & Russian locales. More translations are welcome.
  • Fields are configurable to be displayed / not displayed and required / not required.
  • Uses your Rails apps mail configuration. But you can configure who should receive notifications from contact form.
  • Right now it's not coupled too tightly with CMS, so you might be able to use it outside of it as well. At least I don't see any reason why it wouldn't work.
  • Uses HAML & SimpleForm, but it can be easily overridden in your views if you want to.
  • I use it with Rails 3 and CMS 1.8 , however it should be usable with Rails 4 and CMS 1.9 . I will shortly start a new project that should confirm this.
  • Uses new hash syntax, so it's Ruby > 1.9 only.
  • Modify order in which fields are rendered. No need for overriding the view.
  • Uses minimal styling inside views, so entirely possible to style your contact form without touching gem at all with just a few rules in your application.css . If you use simple_form elsewhere it will just use your simple_form styling you already setup in your app.
  • Often Contact Us page has address / phone information & google / yahoo / bing map. A proper Imprint / Impressum / Masthead page like in German-speaking countries. This is implemented as Location model ( to hold multiple branches if availalbe). You can just use a partial if you need to place it somewhere else on your site, or you can just override the view.
  • Social Contacts & special contacts that you want to display through out your website can be configures in initializer ( think links to Facebook and 1-800 number)
  • Contact categories are not implemented and are not likely to be implemented. (A drop down option to contact different departments.) It's an antifeature! Based on experience, customers often don't know which department they need. It creates an extra step for them to complete. Emails get routed to the wrong person / department and entropy is increased. It's much better to either route to a responsble person who will redirect email based on request OR send it to a group email like [email protected] where a group of people can see it. Also in one case all emails were routed to [email protected] which was pickup email for Redmine, which automatically create a support ticket.

Upcoming Features

Pull Requests are welcome!

See current lest at : https://github.com/konung/comfy_imprint/issues?labels=enhancement&page=1&state=open

  • Tests, Tests, Tests!
  • Admin interface tie-in. Right now you need to use either a GUI tool for your DB or do some kind of export on ComfyImprint::Contact.all from console or rake task if you want to look at your contact attempts outside of your email.
  • Integration with delayed_job for sending emails. Right now I do this manually by overriding controller.
  • Adding some kind of Captcha mechanism.

##Usage

  # Gemfile
  gem 'comfy_imprint'
  bundle install

  # Migrations
  rake comfy_imprint:install:migrations
  rake db:migrate

  # Routes
  mount ComfyImprint::Engine, at: "/contact-us"

  # Config
  # copy & edit initializer
  rake comfy_imprint:install:copy_initializer

Name

Why didn't I name this ComfyContact or something similar? Because dealing with ComfyContact::Contact.contact is confusing and because I already have unrelated resource named Contact. While this gem is properly namespaced, it would be confusing for anyone else not familiar with your app. I'm guessing I'm not the only genius to have unrelated model called Contact in my app.

Acknowledgement and thank yous

This gem was made possible due to generosity of folks at http://www.birica.com

This project rocks and uses MIT-LICENSE.

comfy_imprint's People

Contributors

dependabot[bot] avatar kastman avatar konung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

comfy_imprint's Issues

Add tests

Pretty much need to cover the whole gem. I don't there are a lot of tests that need to be written:

  • routes
  • validations
  • email sending

for now

Make contact form pluggable.

Make sure form can be used anywhere on the site not just at the mount point. Some of my clients requested contact form to be visible in the header / footer on all pages.

Add ability to configure contact details on the contact page.

Often Contact Us page has address / phone information & google / yahoo / bing map. So adding those would be nice. A proper Imprint / Impressum / Masthead page like in German-speaking countries. Right now this can be done manually by overriding view but in the future I would like to add this functionality so my users can update their own phone numbers and such.

  • should be able to control / display at least:
    • location name (like a branch name),
    • address,
    • phone,
    • fax,
    • email
    • notes
    • map link to google (at least) and maybe yahoo or bing
  • should handle multiple locations
  • add admin interface tie-in for CMS

Adding Captcha / ReCaptcha mechanism to fight SPAM

When I used other contact forms - I used to get a lot of emails from spambots. It seems to have stopped for now. I'm guessing it has mostly to do with validations on the form. For now I'll put this under review, and will need to investigate further.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.