Code Monkey home page Code Monkey logo

maily_herald-webui's Introduction

MailyHerald Web UI

Web interface for MailyHerald - Ruby on Rails email marketing solution.

Requirements

Both Ruby on Rails 3.2 and 4 are supported.

Installation

Simply just run

gem install maily_herald-webui

or put in your Gemfile

gem "maily_herald-webui"

Usage

Mount the WebUI in your application:

# config/routes.rb
mount MailyHerald::Webui::Engine => "/maily_webui"

Customizing

Restricting access

The simplest way to restrict access to the Maily WebUI is to use Rails routing constraints:

# config/routes.rb
mount MailyHerald::Webui::Engine => "/maily_webui", :constraints => MailyAccessConstraint.new

A sample MailyAccessConstraint implementation might look like this:

class MailyAccessConstraint
  def matches?(request)
    return false unless request.session[:user_id]
    user = User.find request.session[:user_id]
    return user && user.admin?
  end
end

HTTP Basic auth can be used too:

# config/routes.rb
MailyHerald::Webui::Engine.middleware.use Rack::Auth::Basic do |username, password|
  username == ENV["MAILY_USERNAME"] && password == ENV["MAILY_PASSWORD"]
end if Rails.env.production?

mount MailyHerald::Webui::Engine, at: '/maily_webui

Entity names

By default the WebUI displays entities (i.e. your users) using the to_s method. You can easily overwrite this method in your model to see your user names in the WebUI. Example below:

class User < ActiveRecord::Base

  # ...

  def to_s
    "#{self.firstname} #{self.lastname}"
  end
end

More Information

For bug reports or feature requests see the issues on Github.

License

LGPLv3 License. Copyright 2013-2015 Sology. http://www.sology.eu

maily_herald-webui's People

Contributors

ardahaal avatar ljachymczyk avatar

Watchers

 avatar  avatar

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.