Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Onno Sloof 13 posts 84 karma points
    Dec 24, 2019 @ 12:18
    Onno Sloof
    0

    Formulate email handler not working on 3.1

    Hi,

    I installed Formulate 3.1 on an Umbraco 8.2 website. With some help from https://our.umbraco.com/packages/backoffice-extensions/formulate/formulate-questions/98662-form-rendering-formulate-in-3plus I succeeded in rendering the form. Submitting works great, but an email is not sent. I've checked the mailsettings in web.config and tested with an online smtp-test to see if these settings are working. This works fine.

    What is going wrong? Is Formulate on Umbraco 8 only possible with Plain-Javascript? On an other site with Umbraco 7, Formulate and emailing is working great.

    Who can help me?

    Regards,

    Onno Sloof

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Dec 30, 2019 @ 19:20
    Nicholas Westby
    0

    Sorry for the delay.

    Is Formulate on Umbraco 8 only possible with Plain-Javascript?

    Unsure what you mean. As opposed to the Angular template? Both should work, I would think (though I recommend the plain JavaScript template).

    What is going wrong?

    Have you tried setting up a "Store Data" handler (and disable or remove the email handler)? If that works, I would imagine there is some issue with the SMTP configuration in the web.config, or perhaps with the setup in the email handler (e.g., the sender email address).

    Can you share a screenshot of the email handler?

    You can also test by having the email be stored on the file system with this configuration in your web.config:

    <mailSettings>
      <smtp deliveryMethod="SpecifiedPickupDirectory">
        <specifiedPickupDirectory pickupDirectoryLocation="c:\temp\email"/>
      </smtp>
    </mailSettings>
    

    You will need to make sure the directory exists before trying that.

  • Onno Sloof 13 posts 84 karma points
    Jan 02, 2020 @ 16:18
    Onno Sloof
    0

    Hi Nicholas,

    Thanks for you input. On http://www.formulate.rocks/plain-javascript/render-form I can read "Also, this applies to Umbraco 8. For the Umbraco 7 version". So, is for Umbraco 8 only the plain-javascript method possible? In https://our.umbraco.com/packages/backoffice-extensions/formulate/formulate-questions/98662-form-rendering-formulate-in-3plus Daniel says: "The instructions from your site http://www.formulate.rocks/render-form no longer seem valid. Namely, 'Rendering' is no longer present in the 'formulate.api' namespace".

    I've tested with "Store Data". That's going fine. I also changed the mailsettings with the one for store on the file system, but thats also not working. (directory c:\temp\email exists)

    My contact.cshtml is:

    section class="resume-section summary-section mb-5">
        <h2 class="resume-section-title text-uppercase font-weight-bold pb-3 mb-3">@Model.ContentTitle</h2>
    <div class="resume-section-content">
        <p class="mb-0">@Model.Value("bodyText")</p>
    
        <div class="formulate-wrapper">
    
            @* Render the form. *@
            @Html.Action("Render", "FormulateRendering", new { form = Model.FormulateForm })
    
        </div>
    
        @* The JavaScript file for Formulate's plain JavaScript template. *@
        <script src="/App_Plugins/formulate/responsive.plain-javascript.min.js" async></script>
    
        @* This is your JavaScript that handles events dispatched by Formulate. *@
        <script src="/scripts/custom-formulate-script.js" async></script>
    
    </div>
    

    The form is rendering fine and when I click submit, I'm getting the message the form is submitted. But nothing in the c:\temp\email folder.

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jan 02, 2020 @ 17:34
    Nicholas Westby
    0

    I think these may answer some of your questions:

    • This page was updated recently for Umbraco 8 (the forum post you are referencing was from before that page was updated): http://www.formulate.rocks/plain-javascript/render-form
    • Yes, the plain JavaScript template works with the SMTP handler.
    • I just tested the SMTP handler with Umbraco 8 using the plain JavaScript handler and an SMTP configuration as described above and it stored a file on the file system.

    It might help if you shared a screenshot of your email handler. Here's a screenshot of mine:

    Screenshot of the email handler I've configured in Formulate.

    You may also want to check your error log after you submit a form.

  • Onno Sloof 13 posts 84 karma points
    Jan 03, 2020 @ 09:58
    Onno Sloof
    0

    Hi Nicholas,

    Tried to sent a User Invitation with mailsettings as below, that works fine. The email file is in the c:\temp\email folder.

    <mailSettings>
      <smtp deliveryMethod="SpecifiedPickupDirectory">
        <specifiedPickupDirectory pickupDirectoryLocation="c:\temp\email"/>
      </smtp>
    </mailSettings>
    

    My mailhandler is (changed the mail domains for now):

    image handler

    But when sending the form, no mail in the temp\email folder.

    If there is something more you like to have, I can sent it to you.

    Onno

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jan 03, 2020 @ 17:33
    Nicholas Westby
    0

    Can you make sure your email handler is enabled? It isn't shown in your screenshot, so I can't check. It's the little eyeball icon to the right of the handler. You can see it in my previous screenshot.

    And you'll want to double check the error logs after you submit a form.

  • Onno Sloof 13 posts 84 karma points
    Jan 04, 2020 @ 09:51
    Onno Sloof
    0

    Hi Nicholas,

    The handler is enabled. See screenshot: enter image description here

    Also, there are no errors after submitting the form:

    enter image description here

    I will try to test with a very simpel form.

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jan 03, 2020 @ 17:35
    Nicholas Westby
    0

    Another thing you can try is using a super simple form. Just a "Message" field and a "Submit" button. And configure the handler very simply (e.g., no need to "Include Specific Fields").

  • Onno Sloof 13 posts 84 karma points
    Jan 04, 2020 @ 10:29
    Onno Sloof
    0

    Hi Nicholas, Just tried with a very simpel test form.:

    enter image description here enter image description here Testhandler (email not filled for the screenshot) enter image description here Form submitted (very quick!) but no email in folder

    Form was submitted very quick, but nothing in the folder.

  • Onno Sloof 13 posts 84 karma points
    Jan 04, 2020 @ 11:16
    Onno Sloof
    1

    Hi Nicholas,

    Problem solved!!! And so simple. Why didn't we think about this before :).

    It looks like when installing Formulate (in my case with "Manage Nuget packages for solution"), in the file FormulateConfiguration.json the setting 'Whitelist' is enabled by default. When setting this to false, form submit is working and putting a email file in the c:\temp\email folder.

    So, what are the possible settings in:

    Whitelist":{"Enabled":false,"AllowedEmails":[{"Email":"[email protected]","Domain":null},{"Email":null,"Domain":"site.com"}]}
    

    And another, totaly different, question: What is the best way to redirect to a custom page after the form is submitted?

    Thanks,

    Onno

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jan 06, 2020 @ 02:05
    Nicholas Westby
    0

    I'm glad you were able to get it working. I've just made a change so the default will be to skip the whitelisting: https://github.com/rhythmagency/formulate/issues/162

    It'll be included with the next release of Formulate.

    So, what are the possible settings in:

    I believe the file is installed with the possible settings. You can set either a domain or an email and that email or domain will be whitelisted.

    What is the best way to redirect to a custom page after the form is submitted?

    Listen for the JavaScript event ("formulate form: submit: success") and then redirect (e.g., by setting window.location to whatever URL you want). That's assuming the plain JavaScript template. I imagine there is something similar for the Angular template, but I can't remember offhand.

    I usually never do that though. Instead, I just show a thank you message in place of the form (i.e., without navigating to another page).

Please Sign in or register to post replies

Write your reply to:

Draft