Git Product home page Git Product logo

contact-form's People

Contributors

angrybrad avatar billmn avatar boboldehampsink avatar brandonkelly avatar cityzen avatar danbrellis avatar dommmel avatar fyrebase avatar hiasl avatar i-just avatar jasonetco avatar lassemt avatar machour avatar makeilalundy avatar michtio avatar narration-sd avatar nathanheffley avatar nicholashamilton avatar nstcactus avatar olivierbon avatar rafrobeat avatar realjoshharrison avatar sa3dany avatar selvinortiz avatar swey avatar timkelty avatar tpmatthes avatar ttempleton avatar watarutmnh avatar williamisted avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contact-form's Issues

Vague error message

This is probably the same thing others are running into, but I can't seem to solve it.

I've set up a simple form, and no errors come back on form submission. However, the redirect doesn't happen, and the page comes back with all the information in the form fields. When I finally went to the plug-in page, a banner appeared and said:

There was a problem with your submission, please check the form and try again!

I've tried the test email, and it works with my real email.
I've tried creating a fake email with the same domain as the dev environment, to no avail.

What am I missing?

Required inputs

I can't find anything in the documentation... and I might be missing something obvious. But is there a way to enforce required fields?

Do I need to create my own plug-in to do so?

Email error: Could not instantiate mail function.

I know this is probably an issue with the correct mail software not being installed on the server, but I was wondering if there was a preferred method or fix for this error from the plugin developers.

Ajax POST is sending HTML of home page as reponse

I'm using the described Ajax method to handle contact form submissions and receiving as a response the full HTML markup from the homepage rather than the JS object that the Readme describes.

I'm pretty sure I'm following the example but just to be sure here is JS I have...

var sendValidForm = function( $form ) {
    var data = $form.serialize();
    // I'm getting the URL from a data attribute on the form in the template
    // which looks like this: data-post-to="{{ siteUrl }}"
    var postTo = $form.data('post-to');

    console.log('Form data');
    console.log(data);

    // Send it to the server
    $.post( postTo , data, function( response ) {
        if ( response.success ) {
            afterSubmission( $form );
        } else {
            console.log(response);
            formError( $form, 'An error occurred. Please try again.' );
        }
    });
};

I'm using version 1.7.0 of the plugin, version 2.5.2761 of Craft, and it's running on PHP 5.6.10. I can also confirm that the dashboard shows the plugin is installed and enabled.

Any help would be much appreciated, thanks!

Additional Fields Value

Is it possible to retrieve the value of an additional field? I've tried message.message[Phone] and other combinations but it doesn't return anything.

This is my full field <input class="fieldItem__textInput" type="phone" name="message[Phone][]" id="phone" placeholder="Phone" value="{% if message is defined %}{{ message.message[Phone] }}{% endif %}" />

To Email Limitation

I have an email address set up at a domain with a hyphen. When I use that email as the "To Email" in the plugin settings, I don't receive the mail. The address works otherwise. Other addresses work as the "To Email" also.
Could it be causing a problem because of the hyphen? ex. [email protected]

Internal server error after submit

Hi, love Craft and this looks like a fine plugin and I'm sure it will work on my windows server as well but for now all I get is an internal server error after a successful form submission.
Any tips greatly appreciated!
Cheers, Menno

Should the From email address be same as Reply-to email address?

Hoping to get your take on this if you don't mind:

Is there a reason the From email address is not the same as the Reply-to email?

The admin already knows which site it's from by the subject so, not sure why the admin email address is coming through too. In this example it was my email address:

email

Also, I'm not sure reply-to always works since some email providers use the From email instead (I experienced this with gmail in fact.)

Required Message Field

Would it be possible to not have the message field required? Some forms do not require a message field because they collect data from other input fields.

Unable to resolve the request "contactform/sendMessage"

I'm getting this error when trying to submit a form that is included at the bottom of all pages.

I have

<input type="hidden" name="action" value="contactform/sendMessage">
<input type="hidden" name="redirect" value="message-received">

which I've taken from the docs. I'm running the latest Craft build and v1.4 of the plugin.

Is there anything else I'm missing?

File attachement with AJAX

I'm having trouble receiving attachments when using AJAX form submission.

I'm passing the form data through with:

var data = new FormData(this);

Because serialize() won't work on file fields, but unfortunately this still isn't working (email is sent, attachment ignored).

Any ideas?

name="fromEmail" wrong

Hi Brad

First of all I like your plugin really and use it in every Craft installation.

In the latest Craft version 2.6.2779 and current version of ContactForm (1.7.0) – I guess – I found a bug. I set the recipient address to the address of my customer and the form field for the {{ message.fromEmail }} is in my template like in your code example.
Well, every time when I send a new mail, the {{ message.fromEmail }} is not the e-mail address in the completed field, it's the system e-mail address. In my case the same like the recipient address.

Maybe you guys have some time to check this as well. I tested it in four installation and everywhere I get the same issue.

Cheers from Switzerland,
Selim

Post to form from different domain?

Is it / should it be possible to post the form from a different domain? I already have my accept headers to allow from * (and this works as I load json from craft on to my app)

I'm trying to post using an app, passing the required parameters, but all I get back is "the request timed out" - submitting the form from a craft template works.

I was also considering posting to my own php template on the CMS side and posting the data from there, but I'm not allowed to have php templates?

Doesnt submit or redirect? (Just help)

Hello,

I have used this plugin on three different occasions with no issues whatsoever, that is why I am so dumbstuck on why it doesnt work now.

I have used the exact same code on all sites - tested the email from craft - and for some reason, on submit nothing happens. The site reloads, all the inputs are still there. Here is my redirect:

I have tried redirecting to another page too. Im sure there is something so small and easily fixable that i am missing. If anyone can highlight my oversight (or any normally over looked areas that i should look in to), that would be great. THANKS!

Reply-To does not work with Gmail

Unfortunately Gmail ignores the Reply-To email header if the From address is the same as the To address (or is configured as a "Send as..."-Account in the Gmail settings), as it is the case with the ContactForm plugin.

So if you receive an email from the plugin in gmail and click Reply, it fills in your own address in the To field of the reply, and not the address of the person submitting the form.

This could be fixed by adding a config setting "From Email" and configuring it with something like [email protected].

Required Fields

Hi, just wondering if there would be any future updates that add required fields? Essentially giving the client the ability to choose which input fields are required, including an error if the user does not enter information. Thanks in advance!

Error on navigating from page

Hi,

I have implemented this contact form in my footer and its working as expected, until I click on any link and move from the main page:

Twig_Error_Runtime

Impossible to access an attribute ("fromName") on a string variable ("") in "_includes/footer" at line 57 (C:\wamp\www\autumndev\craft\app\vendor\twig\twig\lib\Twig\Template.php:388)

#0 C:\wamp\www\autumndev\craft\app\etc\templating\BaseTemplate.php(40): Twig_Template->getAttribute('', 'fromName', Array, 'any', false, false)
#1 C:\wamp\www\autumndev\craft\storage\runtime\compiled_templates\1d\d9\7011bc8fccb78c279d1426337974a0cf94ad1f27c90f6592f3bce33b1b1c.php(126): Craft\BaseTemplate->getAttribute('', 'fromName')
#2 C:\wamp\www\autumndev\craft\app\vendor\twig\twig\lib\Twig\Template.php(278): __TwigTemplate_1dd97011bc8fccb78c279d1426337974a0cf94ad1f27c90f6592f3bce33b1b1c->doDisplay(Array, Array)
#3 C:\wamp\www\autumndev\craft\app\vendor\twig\twig\lib\Twig\Template.php(252): Twig_Template->displayWithErrorHandling(Array, Array)
#4 C:\wamp\www\autumndev\craft\storage\runtime\compiled_templates\9c\bf\68451ca0ea3b938050b4f99d8b4f919f102ac30eb0a0f06c08f764464a24.php(74): Twig_Template->display(Array)
#5 C:\wamp\www\autumndev\craft\app\vendor\twig\twig\lib\Twig\Template.php(278): __TwigTemplate_9cbf68451ca0ea3b938050b4f99d8b4f919f102ac30eb0a0f06c08f764464a24->doDisplay(Array, Array)
#6 C:\wamp\www\autumndev\craft\app\vendor\twig\twig\lib\Twig\Template.php(252): Twig_Template->displayWithErrorHandling(Array, Array)
#7 C:\wamp\www\autumndev\craft\storage\runtime\compiled_templates\ef\e0\013b7ec852e7ba0e54f3e5b825242f295c7cdbd7a182b126c82816f35323.php(26): Twig_Template->display(Array, Array)
#8 C:\wamp\www\autumndev\craft\app\vendor\twig\twig\lib\Twig\Template.php(278): __TwigTemplate_efe0013b7ec852e7ba0e54f3e5b825242f295c7cdbd7a182b126c82816f35323->doDisplay(Array, Array)
#9 C:\wamp\www\autumndev\craft\app\vendor\twig\twig\lib\Twig\Template.php(252): Twig_Template->displayWithErrorHandling(Array, Array)
#10 C:\wamp\www\autumndev\craft\app\vendor\twig\twig\lib\Twig\Template.php(263): Twig_Template->display(Array)
#11 C:\wamp\www\autumndev\craft\app\vendor\twig\twig\lib\Twig\Environment.php(292): Twig_Template->render(Array)
#12 C:\wamp\www\autumndev\craft\app\services\TemplatesService.php(158): Twig_Environment->render('404', Array)
#13 C:\wamp\www\autumndev\craft\app\controllers\BaseController.php(75): Craft\TemplatesService->render('404', Array)
#14 C:\wamp\www\autumndev\craft\app\controllers\TemplatesController.php(156): Craft\BaseController->renderTemplate('404', Array)
#15 C:\wamp\www\autumndev\craft\app\framework\web\actions\CInlineAction.php(49): Craft\TemplatesController->actionRenderError()
#16 C:\wamp\www\autumndev\craft\app\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#17 C:\wamp\www\autumndev\craft\app\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#18 C:\wamp\www\autumndev\craft\app\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), NULL)
#19 C:\wamp\www\autumndev\craft\app\framework\web\CWebApplication.php(282): CController->run('renderError')
#20 C:\wamp\www\autumndev\craft\app\framework\base\CErrorHandler.php(331): CWebApplication->runController('templates/rende...')
#21 C:\wamp\www\autumndev\craft\app\framework\base\CErrorHandler.php(204): CErrorHandler->render('error', Array)
#22 C:\wamp\www\autumndev\craft\app\etc\errors\ErrorHandler.php(112): CErrorHandler->handleException(Object(Craft\HttpException))
#23 C:\wamp\www\autumndev\craft\app\framework\base\CErrorHandler.php(129): Craft\ErrorHandler->handleException(Object(Craft\HttpException))
#24 C:\wamp\www\autumndev\craft\app\framework\base\CApplication.php(732): CErrorHandler->handle(Object(CExceptionEvent))
#25 [internal function]: CApplication->handleException(Object(Craft\HttpException))
#26 {main}

Line 57 is as follows:

<input id="fromName" type="text" name="fromName" value="{% if message is defined %}{{ message.fromName }}{% endif %}" placeholder="Name" class="form-control" >

I believe its because the form is declared on a tempalte that is included on every page, is there a fix for this?

Issue installing plugin

When I try and install v1.7.0 in Craft Client 2.5.276, I get the following error:

CException

Craft\Model and its behaviors do not have a method or closure named "subject".

Doesn't mean much to me. Any idea why I can't install the plugin? Thanks.

Failed Submission Set Reload at div id

Is there anyway to stop the form from reloading at the top of the page and instead have the page reloaded at a particular id location (e.g.

) when errors are detected? Depending on where the form is located, a user may have no idea submission failed unless they scroll down to see errors.

Notify Page that Email has been sent

I would like to return users to the same page that they sent the email from, but wanted to know if there were any variable passed along with the request or anything, so I could display a message, letting the user know we received the email.

Stumped - test form submits / real form wont

I have the following code on a local testpage:

        <form class="form-contact validate-me" action="" accept-charset="UTF-8" enctype="multipart/form-data">
            <p class="caption">Graag alle vakjes met een <strong>asterisk (*)</strong> invullen.</p>
            <input type="hidden" name="action" value="contactForm/sendMessage">
            <input type="hidden" name="redirect" value="sollicitatie/bedankt">
             {# honeypot field #}
            <input id="kandidaat" name="kandidaat" type="text"  style="display:none;">
            <fieldset>
                <div class="field-container">
                    <label for="fromName">Naam en voornaam<abbr title="required"><strong>*</strong></abbr></label>
                    <input id="fromName" name="fromName" type="text" placeholder="" class="required" title="Vul je naam in" />
                </div>
                <div class="field-container">
                    <label for="rijksregisternummer">Rijksregisternummer<abbr title="required"><strong>*</strong></abbr></label>
                    <input id="rijksregisternummer" name="message[rijksregisternummer]" type="text" placeholder="" class="required" title="Een geldig rijksregisternummer is verplicht" value="" />
                </div>
                <div class="field-container">
                    <label for="woonplaats">Woonplaats<abbr title="required"><strong>*</strong></abbr></label>
                    <input id="woonplaats" name="message[woonplaats]" type="text" placeholder="" class="required" title="Een geldige woonplaats is verplicht" value="" />
                </div>
                <div class="field-container">
                    <label for="fromEmail">E-mail <abbr title="required"><strong>*</strong></abbr></label>
                    <input id="fromEmail" name="fromEmail"  type="fromEmail" placeholder="" class="required" title="Een geldig e-mail adres is verplicht" value="" />
                </div>
            </fieldset>

            <fieldset>
                    <label for="attachment">Upload je CV (.doc of .pdf)</label>
                    <p>Upload hier je CV in .doc of .PDF formaat.</p>
                    <div class="field-container">
                        <input id="attachment" name="attachment" type="file" />
                    </div>
                </fieldset>

            <fieldset>
                <div class="field-container">
                    <label for="message">Extra opmerkingen</label>
                    <textarea id="message" name="message[body]" rows="5" placeholder="Wil je ons nog iets laten weten? Dat kan hier."></textarea>
                </div>
            </fieldset>
            <fieldset class="form-submit">
                <input type="submit" value="Verstuur sollicitatie" class="button button--form">
            </fieldset>
        </form> 
        {# ===================== #}
        {# test form #}

            <form method="post" action="" accept-charset="UTF-8" enctype="multipart/form-data">
                <input type="hidden" name="action" value="contactForm/sendMessage">
                <input type="hidden" name="redirect" value="sollicitatie/bedankt">

                <input id="kandidaat" name="kandidaat" type="text">

                <h3><label for="fromName">Your Name</label></h3>
                <input id="fromName" type="text" name="fromName" value="">


                <h3><label for="fromEmail">Your Email</label></h3>
                <input id="fromEmail" type="text" name="fromEmail" value="">


                <h3><label for="subject">Subject</label></h3>
                <input id="subject" type="text" name="subject" value="">

                <h3><label for="message">Message</label></h3>
                <textarea rows="10" cols="40" id="message" name="message[body]"></textarea>

                <h3><label for="woonplaats">woonplaats</label></h3>
                <input id="woonplaats" type="text" name="message[woonplaats]" value="">

                <h3><label for="rijksregisternummer">rijksregisternummer</label></h3>
                <input id="rijksregisternummer" type="text" name="message[rijksregisternummer]" value="">

                <label for="attachment">cv upload</label>
                <input type="file" name="attachment">

                <input type="submit" value="Send">
            </form> 
            {# ===================================== #}

The test from submits fine, the actual form (which to my eyes is identical) gives a

Bad Request
The request could not be understood by the server due to malformed syntax.

error.
The query string submitted is
http://wgcdesleep.dev:8888/jobs/solliciteer?action=contactForm%2FsendMessage&redirect=sollicitatie%2Fbedankt&kandidaat=&fromName=Erwin+Heiser&message[rijksregisternummer]=6546546565&message[woonplaats]=errrrr&fromEmail=erwin.heiser%40gmail.com&attachment=bereikbaarheid_winkelhaak_2014.pdf&message[body]=eeee+e+eee+ee+

Any ideas? I'm stumped.

Question about succesfull submit

Since we have a one page website I would always like to return to the same page, using an anchor to direct to the right section. I've managed to do so.
The errors are showing as expected, and the return is correct in case of error and on success.
I would like to detect if the form has successfully submitted so I can display a message to the user. How can I check for this?

All emails going to gmail spam folder

Hi guys,

Great plugin. My issue is that all my emails are going to gmails spam folder. I have had to create a hardcoded subject and create a filter in gmail to stop it going to spam.

Have you guys experienced this before? Gmails spam message is 'Why is this message in Spam? It's similar to messages that were detected by our spam filters'. Is there a setup for fromEmail and subject etc that you know of that stops it going to spam? My sender name is the same as domain name so I know it's not that issue.

Thanks!

fromEmail is incorrect?

I'm really confused about the fact that the fromEmail is not to be found in the mail that I am receiving. Not even as the reply address ... the reply address is the address of the admin. If I fill in "[email protected]" as "fromEmail" ... I expect to receive the form at the address which is configured within the plugin with the "fromEmail" as "from/reply" address. This seems to be some kind of bug?

onBeforeSend()

Hey Guys,
Would you be open to adding an onBeforeSend() event so that a plugin like spamguard can validate (inspect for spam) the content to be sent?

This would allow people to use your contactform without any changes and use spamguard alongside if they choose to do so with no workarounds!

Line break in emails

When receiving the emails the info in the emails are in one line. Is there a way to add line breaks ?

Displaying form data on thanks page

I love this quick and simple plugin! However, I was wondering how you could display the information the was submitted from the form on the contact/thanks page? I'm sure its possible, just not sure how to go about accessing the information.

Feature Request: save form submissions in database

It would be perfect if submissions are saved in the database and an overview of these submissions would be available in the admin area.

This could be a perfect backup tool for the submissions, as well open up new possibilities to manage contacts, potential clients, ...

fromEmail mandatory

Hi guys.

Is there a specific reason to make the fromEmail required? The vast majority of forms ask for an email but sometimes only a telephone number/address is needed.

SPAM Problems + Integrate Google reCAPTCHA with ContactForm

I'm receiving about 2 SPAM messages a day, even though I've enabled the honeypot field. I'm not sure if I've implemented the feature wrong or not. When I try simulating it in my browser by filling in the field, everything works.

The form is here under Get In Touch Today at the bottom, by the way: http://www.ideabasekent.com

Has anyone had success integrating this with Google's reCAPTCHA service? I find Google's documentation and instructions to be really confusing.

Internal Server Error on forms with attachments

I've had several people email me saying that when submitting a form containing a file upload field (for an image) they receive the following error:

Internal Server Error: Could not access file.    

It's not happening every time, and isn't limited to a specific browser.

I tried to replicate it using large files but wasn't able to get the error myself.

Show fromEmail and fromName in message body

Is it possible to add in an option to show the sender's email address and name in the message body?

Quite often when these emails are received they are forwarded on to the relevant recipient and therefore losing the reply to address (fromName), it would be very useful if the sender's details are included in the message body as it already does for other fields in the form.

Can't get additional Fields to work

I use the current version of your plugin (1.8.1) and can't get additional Fields to work. This is my code:

  {% set contactEntry = craft.entries.id(entry.id).first() %}
          <form method="post" action="" accept-charset="UTF-8" id="contact-form" class="contact-form">
              {{ getCsrfInput() }}
              <input type="hidden" name="action" value="contactForm/sendMessage">
              <input type="hidden" name="redirect" value="{{ contactEntry.url }}?sent=true&from={fromName}">

              {% set voiceName = craft.request.getParam('voiceName') %}
              {% if voiceName is not empty or (message is defined and message.voiceName is not empty) %}
              <p class="voice-name">
                <input id="voicename" type="text" disabled="disabled" value="{{ "Voice Actor: " | t}}{% if message is defined %}{{ message.VoiceActor }}{% else %}{{ voiceName }}{% endif %}" name="message[VoiceActor]" />
                {{ message is defined and message ? errorList(message.getErrors('voiceName')) }}
              </p>
              {% endif %}

              {% set voiceReference = craft.request.getParam('voiceReference') %}
              {% if voiceReference is not empty or (message is defined and message.voiceReference is not empty) %}
              <p class="voice-reference">
                <input id="voicereference" type="text" value="{{ "Voice Actor Reference: " | t}}{% if message is defined %}{{ message.Reference }}{% else %}{{ voiceReference }}{% endif %}" name="message[VoiceReference]" />
                {{ message is defined and message ? errorList(message.getErrors('voiceReference')) }}
              </p>
              {% endif %}
              <p class="contact-name">
                <input id="contact_name" type="text" placeholder="Ihr Name" value="{% if message is defined %}{{ message.fromName }}{% endif %}" name="fromName" />
                {{ message is defined and message ? errorList(message.getErrors('fromName')) }}
              </p>
              <p class="contact-email">
                <input id="contact_email" type="text" placeholder="Ihre E-Mail Adresse" value="{% if message is defined %}{{ message.fromEmail }}{% endif %}" name="fromEmail" />
                {{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}
              </p>
              <p class="contact-message">
                <textarea id="contact_message" placeholder="Ihre Nachricht" name="message[body]" rows="15" cols="40">{% if message is defined %}{{ message.message }}{% endif %}</textarea>
                {{ message is defined and message ? errorList(message.getErrors('message')) }}
              </p>
              <input type="text" id="company" name="company" style="display:none">
              <p class="contact-submit">
                <button id="contact-submit" class="submit" type="submit">Absenden</button>
              </p>

          </form>

What am I missing? :(

Allow for multiple attachments

Would be great if the form accepted multiple file attachments, with the fields named attachment[0], attachment[1], etc.

Autofilling Honeypots

We just had an issue on a site where the hidden honeypot field was being autofilled by Chrome (version 50.0.2661.102) despite it having a practically nonsense name. In our tests it was being filled with the users country.

To fix this we simply added autocomplete="off" to our honeypot fields.

While this isn't a ContactForm bug, I figure it was worth letting everyone know!

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.