Is it possible to modify the built in Email Handler so it doesn't use the .Net mail for sending (we are not using the inbuilt mailing methods), if so where would I need to look to make the changes?
Also, do you have a very basic example of implementing a datatype? We also use a custom captcha rather than reCaptcha so wanted to add that as a fieldtype also (it is just an image and text box with a js function).
Before I respond, I'll make these assumptions: you are using the lastest version of Formulate (the one for Umbraco 8).
Is it possible to modify the built in Email Handler so it doesn't use the .Net mail for sending (we are not using the inbuilt mailing methods), if so where would I need to look to make the changes?
That way, you would be able to subclass it and just modify that one function.
One more option would be to subclass what's already there and just change the implementation of the HandleForm method. I'm not 100% sure that'll work (e.g., not sure if that method references any private functions/properties). Worth a shot though.
Also, do you have a very basic example of implementing a datatype? We also use a custom captcha rather than reCaptcha so wanted to add that as a fieldtype also (it is just an image and text box with a js function).
Yes, I'm using the latest, Thanks for the info and pointers, I will do some reading and see how I get on. The handler isn't so important, but will take a look at some point, for now I just implemented an api controller and am sending the data to that and processing the data and sending an email which works great.
Now to work on the custom Captcha.
Thanks for giving us a great component, for the basic forms my client wants it is very easy to use and configure.
thanks for the pointers so far, but am abviously missing something :)
my new field appears in the field selector and I can quite happily add
it to the form, however when I try to view the form in the ui I get
the following error
The specified Formulate view could not be located on the file system.
This occurs in renderform.cshtml, the viewpath is null, I assume it
should have a template somewhere.
Ignore that. it was me, I hadn't chosen the javascript responsive template.
However my custom control does not appear on the form I just get an empty row/cell
Unable to find renderer for field of type BotcheckField
Do you have some code like this:
// Store the field renderer configuration on the window so Formulate can access it.
let key = "formulate-plain-js-fields";
window[key] = window[key] || [];
window[key] = {
key: "BotcheckField",
renderer: Botcheck
};
Customize Handler
Is it possible to modify the built in Email Handler so it doesn't use the .Net mail for sending (we are not using the inbuilt mailing methods), if so where would I need to look to make the changes?
Also, do you have a very basic example of implementing a datatype? We also use a custom captcha rather than reCaptcha so wanted to add that as a fieldtype also (it is just an image and text box with a js function).
Before I respond, I'll make these assumptions: you are using the lastest version of Formulate (the one for Umbraco 8).
Sort of. One option would be to copy the existing email handler and customize it to your needs: https://github.com/rhythmagency/formulate/blob/v3.3.6/src/formulate.app/Forms/Handlers/Email/EmailHandler.cs
Be sure to change the
TypeId
andTypeLabel
.Another option would be to submit a pull request that moves the code that sends the email into a protected virtual method: https://github.com/rhythmagency/formulate/blob/v3.3.6/src/formulate.app/Forms/Handlers/Email/EmailHandler.cs#L333-L337
That way, you would be able to subclass it and just modify that one function.
One more option would be to subclass what's already there and just change the implementation of the
HandleForm
method. I'm not 100% sure that'll work (e.g., not sure if that method references any private functions/properties). Worth a shot though.This explains that: https://www.formulate.rocks/articles/custom-field-types
You might also want to refer to the existing implementation of the recaptcha field:
You can also refer to the other field types (e.g., the text field might be useful to refer to, since it is very simple).
Yes, I'm using the latest, Thanks for the info and pointers, I will do some reading and see how I get on. The handler isn't so important, but will take a look at some point, for now I just implemented an api controller and am sending the data to that and processing the data and sending an email which works great.
Now to work on the custom Captcha.
Thanks for giving us a great component, for the basic forms my client wants it is very easy to use and configure.
Hi,
Ignore that. it was me, I hadn't chosen the javascript responsive template.
However my custom control does not appear on the form I just get an empty row/cell
I get this error in the javascript console, have I miss named something perhaps?
Unable to find renderer for field of type BotcheckField
'BotcheckField is the name of the cs class I created, but I think in the js files I call it just Botcheck, should the class name match?
Do you have some code like this:
Based on the instructions here: https://www.formulate.rocks/articles/custom-field-types
That JavaScript should probably be referenced before the main Formulate JavaScript.
tried a few combinations and now I'm getting something displayed :) Not exactly what I was expecting :D but getting there, thanks for all the help.
Once again, many thanks for all the advice, I am almost there now.
Nice work, looks like it's coming along well!
is working on a reply...