Hi @PeterOx
A secure solution is to create an HTML form that submits user input via JavaScript to an AWS Lambda function. The Lambda function processes the data and uses Amazon SES to send emails.
Another one is to use php script on your server, depend on your webhost services and your security need. Don’t know if I help here
Well it could be helpful if I knew anything about “JavaScript to an AWS Lambda function” maybe a “php script on the server” which I think would be possible.
My only problem is I’m a designer not a coder, so I would not have any idea where to start!!
Would it be possible to get a generic “php script” written that could be used for multiple purposes, or additionally the script could be edited for bespoke use???
Hi @PeterOx
Yes it is possible to write a script in php (or find a ready-made one on the web, I could provide you with one too), but the security issue requires some coding knowledge so that your site is protected.
Maybe you could take a look at Sitelok by Vibralogix. It is a very complete and powerful php script for site protection (the entire site or page by page) which allows you to create access reserved for members. But for your needs it also offers forms that are completely editable according to your needs and protected against web attacks (honeypot, captcha, turnstile). The license is very reasonable for a product of this quality and the support is super top.
The problem with forms is that they are gateways to the server, which is why it is not easy to install a “ready-to-use” one on your site (many webhosts complicate the task for this reason).
Apart from all this, you can go through an external service such as Mailchimp but the costs are far from insignificant.
Do not hesitate to ask me questions if you wish, I “struggled” a lot before finding the right solution for each of my sites (I am in fact in the process of repatriating everything under Sitelok which suits me perfectly). Perhaps @Jeremy can give you his opinion as well?
Forms (and Form Actions) became problematic in Freeway because of spam issues: unless you are careful and know what you are doing, sending emails from a web domain is likely to get you blacklisted, and the emails will never arrive.
I’ve discussed this with Simon in the past, and we concluded that the options are:
Use an online form generator. This can be added to an Xway site via markup items or iframes (depending on the instructions).
Write some backend code (PHP or JavaScript) along with HTML form code and use that with a mailing service.
The second option is how we added the contact form on the Softpress website. We used Mailgun as the mailing service (since we were already using it for Softpress Talk emails) and Simon wrote the backend code (using JavaScript).
The first option is easier, and is what I would choose out of these two options: I’m a Swift (applications) programmer, and I have very little experience writing backend code.
But I’m interested to know that Sitelok has support for forms. Vibralogix sell two products that could be useful to Xway users: Sitelok (site protection) and Vibracart Pro (a shopping cart). They also provide tutorials on using these products with Xway. So this could be a third option.
It’s also worth considering whether you need to use a contact form. Another way for people to contact you is via a mailto link. A possible drawback is that if you provide your email address on a website, it could be harvested by spam bots. There are two ways to mitigate against this: 1. Obfuscate the link (select the Obfuscate checkbox in Xway) to make it (a bit) harder for spam bots to harvest, 2. Use a temporary email address that you can replace if it starts getting spammed.
If it is at all helpful, Google Forms is a decent solution to creating different types of forms. They are not hosted on your site, but can be customized reasonably well to reflect your look and feel. I use them on my site with Xway, you can see the result at https://bgfa.us and click on “Join our email mailing list” on the home page. I have also used them for RSVPs for our public events, and also the unsubscribe link in our email announcements goes to a Google Form. Keep in mind that they are not a mailing list manager, the emails collected are processed manually on our end and we use special mailing software to send out announcements (Max Bulk Mailer and Auth SMTP).
Jeremy did say backend code but just because “JavaScript” will typically evoke the idea of code running in the browser, I want to clarify that this part is the same as a PHP script - it’s running on the server.
The key element is that it’s using a mailing service, we don’t send emails ourselves. Email is much harder than it appears, they are trivial to send but having them delivered is more involved.
The setup is actually similar, both sending ourselves or using a mailing service need a backend script and both need SPF, DKIM and DMARC records created. The main benefit is that they will monitor deliverability and solve problems like being blacklisted (e.g. by Gmail), typically without you having to do anything.
Form providers, on the other hand, can be much simpler. They usually let you build a form and give you an iframe to drop in your website, which submits to their servers so you don’t need a backend script and they don’t need to send email on your behalf so you don’t need to do anything with SPF/DKIM/DMARC.
I completely forgot to say why I finally decided to repatriate everything under Sitelok: I use its AWS SES plugin. Thus, in particular for my newsletter or surveys, I prepare my form and then it is sent to the AWS (Amazon) SES service (email sending management). This service has a price that is unbeatable compared to anything else that exists, that’s why I chose it. I would like to point out that I do not hold any shares in Vibralogix or Amazon
Otherwise there is Machform in self hosting option.