Sandglaz Blog

Maktoub: a simple newsletter engine for Rails

Agile Development Sandglaz News

Maktoub (meaning letter in Arabic), is a Rails newsletter engine & gem that we are open-sourcing and sharing on github.

The story

Our user base is growing really fast, and with that growth we are seeing increased costs. Don’t get me wrong, I’m not complaining; this is a great problem to have! We are so very happy with the growth. But we still need to manage our costs. One of our increased costs was due to using the excellent Mailchimp service to manage our newsletter. After a fruitless search for an open-source replacement to Mailchimp, we decided to build our own. Hence, we’re introducing Maktoub, a simple rails engine to send newsletters.

Features & Capabilities

  • Provides a default layout for authoring your newsletter
  • Uses regular Rails view partials to write the content
  • Has rake tasks for delivering the newsletter
  • Provides controller and routes to view the newsletter in a browser
  • Has easy initialization of emails, subscribers, facebook, and twitter pages
  • Sends emails in multipart text/html
  • Appends parameters for Google Analytics source, campaign and medium tracking
  • Leverages ActionMailer

What’s missing

  • Generator for initializers
  • Web editor interface
  • Email open tracking
  • Management of multiple subscriber lists

If you like the gem and need any of these missing features, you are welcome to contribute.


Thanks to the Ruby and Rails communities for providing all the awesome open source tools. Also thanks to MailChimp for sharing their excellent email templates.

Sandglaz is the easiest way to collaborate with your team. Learn More

  • does it work with rails 4?

  • Artsoldier

    I’ve done everything what is said on the github page, but in my app no email is send out 🙁

    • please open an issue on Github with the exact details of what you did so that we can help you.

  • sartaj singh

    Hi, I have configured your gem as per instruction, per seems not working at all .. the document for instruction are very less and not able to understand how we need to configure and how it should work

    • Please open an issue on GitHub with the exact details of what you did so that we can help you.

  • Awesome, but how do you send out emails – do you host an own mailserver?

    • Maktoub uses whatever mail configuration you have for your Rails app.

  • Etika Ahuja

    unable to send email to subscribers, where i am wrong?

    on using Maktoub::NewsletterMailer.publish(‘my_newsletter_partial’, name: ‘User name’, email: ‘’)

    Rendered maktoub/newsletters/newsletter.html.erb within layouts/maktoub/newsletter_mailer (290.3ms)

    Rendered /home/ebb/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/maktoub-0.5.3/app/views/layouts/maktoub/_styles.erb (18.4ms)

    Maktoub::NewsletterMailer#publish: processed outbound mail in 5323.4ms

    ActionView::Template::Error: No route matches {:action=>”index”}

    • Did you replace ‘my_newsletter_partial’ with your actual newsletter name?

      • Etika Ahuja

        yes i did, i have created a partial named _newsletter in maktoub folder->newsletters->_newsletter.html.erb

        • Can I ask you to open an issue in the github repo itself and I’ll try to help when I get a chance.

          • Etika Ahuja

            Let me try again, to figure out what’s wrong else i will open it.

          • Etika Ahuja

            i have opened an issue for it.