Giter Club home page Giter Club logo

craft-mandrillform's Introduction

MandrillForm

MandrillForm for Craft is very similar to Pixel & Tonic's ContactForm plugin, but uses Mandrill for sending emails instead of your native mail server (if you have one).

How to install and use:

  1. Place the mandrillform folder in your craft/plugins folder.
  2. Go to Settings > Plugins from your Craft control panel and enable the MandrillForm plugin.
  3. Click on "MandrillForm" to go to the plugin's settings page.
  4. Enter the email address you would like the contact requests to be sent to.
  5. Enter your Mandrill API key.
  6. Enter the subject to appear in the emails you receive.

Sample Form

{% macro errorList(errors) %}
    {% if errors %}
        <ul class="errors">
            {% for error in errors %}
                <li>{{ error }}</li>
            {% endfor %}
        </ul>
    {% endif %}
{% endmacro %}

<form method="post" action="" accept-charset="UTF-8">
    <input type="hidden" name="action" value="mandrillForm/sendMessage">
    <input type="hidden" name="successRedirectUrl" value="success">

    <h3><label for="fromEmail">From Email</label></h3>
    <input id="fromEmail" type="text" name="fromEmail" value="{% if message is defined %}{{ message.fromEmail }}{% endif %}">

    {% if message is defined %}
        {{ _self.errorList(message.getErrors('fromEmail')) }}
    {% endif %}

    <h3><label for="fromName">From Name</label></h3>
    <input id="fromName" type="text" name="fromName" value="{% if message is defined %}{{ message.fromName }}{% endif %}">

    {% if message is defined %}
        {{ _self.errorList(message.getErrors('fromName')) }}
    {% endif %}

    <h3><label for="subject">Subject</label></h3>
    <input id="subject" type="text" name="subject" value="{% if message is defined %}{{ message.subject }}{% endif %}">

    {% if message is defined %}
        {{ _self.errorList(message.getErrors('subject')) }}
    {% endif %}

    <h3><label for="message">Message</label></h3>
    <textarea rows="10" cols="40" id="message" name="message">{% if message is defined %}{{ message.message }}{% endif %}</textarea>

    {% if message is defined %}
        {{ _self.errorList(message.getErrors('message')) }}
    {% endif %}

    <input type="submit" value="Submit">
</form>

Roadmap

Right now I've built this plugin very quickly to meet the very specific needs of another project I'm working on. So I've done the bare minimum to get this working, but the more I interact with Mandrill, the more I like the service so I definitely plan on extending the functionality.

  • Robust error handling
  • Tags
  • Better examples (especially AJAX form submissions)

Special Notes

This plugin currently includes v1.0.55 of the Official Mandrill API Client for PHP. The latest wrapper can be found on this packagist repo.

craft-mandrillform's People

Contributors

jmisavage avatar

Stargazers

Alex avatar Eric McNiece avatar Josh Angell avatar Ryan Fleming avatar AJ Griem avatar Michael Reiner avatar

Watchers

Connor avatar James Cloos avatar

Forkers

webremote

craft-mandrillform's Issues

Implementation Questions

Nice plugin for Craft, thanks. Just have a couple of quick questions... where do I edit which fields trigger error responses? And where do I edit which fields will appear in the email that is sent by the form?

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.