FormMail.pl 1.93 Multiple URl contact Form - perl

I am using FormMail.pl version 1.93 for form submission. I have asked this question before for FormMail 3.14m1 but now I am using FormMail.pl version 1.93
I have a single contact-us form and what I would like to do is use this single form such as contactus.html (not multiple copies of this form) everywhere on my website as my site has different contact-us sections based on the department.
Let's say the contact-us form for marketing should email to technical#mydomain.com, contact-us form for sales should email to sales#mydomain.com, HR's contact-us form should email to hr#mydomain.com.
How can I use the single form while redirecting the submission to the appropriate department email address?
I am using FormMail.pl Version 1.93 for email submission

FormMail 1.93 seems to be the version from Matt's Script Archive. The programs from that site are badly written, potentially buggy and (as you have, no doubt, discovered for yourself) unsupported. Even Matt Wright himself no longer recommends their use.
You would be better advised to use the versions from the nms project. It sounds like you were using nms' version 3.14m1, but stopped for some reason. Why is that?
No matter which version you use, your problem is basically the same. In pretty much any version of FormMail the email recipient is either hard-coded in the program or derived from a form input (often a hidden form input) on the HTML page. If you're using the same installation of the program for different email addresses you can't hard-code the address within the program (for, hopefully, obvious reasons). So you're left with getting the address from the HTML page.
But you say you want to use the same form for different contact addresses. I'm not sure how you think this is going to work. How does the form know how it is being used? Are you perhaps embedding the form within various pages using iframes? I suppose it might be possible to change the value of the recipient form input depending on how the form is being accessed. You'd need to do this with Javascript.
The recommended way to approach this is to have a single copy of the FormMail program which is called from several different HTML forms.

Related

How to automatically assign/generate/increment an ID number into Google Form responses, so that respondents can access their own forms based on it?

I would like to set up a (Google) form-filling system, that essentially has to be accessed and filled two times (before and after the completion of a project). I would like to create a form one can return to by filling in an ID number.
For that, I would need a script that automatically generates an ID number for each respondent. I have found 'Google Apps Script for Form, Generate Unique ID Number', but I couldn't get it to work (I am not good at scripting yet). I would like to be able to decide how the ID numbers are generated (for example to have non-numeric characters as well, e.g. XYZ000000001, XYZ00000002, XYZ00000003, etc.)
The reason I want to do this is so that respondents can access their own responses based on the ID assigned to Them. I found two possible solutions, but again, I can't manage them. One code is the 'Class FormResponse' that fetches the existent information (if I understand it well enough), and the other is 'Generate unique Form URL for each respondent' which generates a unique URL for each respondent. That would work fine, but I still need the IDs for easier data maintenance.
This is a lot of code and I'm not sure if it makes sense to combine all of it. Perhaps there is an easier way to achieve what I want with a way simpler script. I will break down the process as I imagine it, into steps:
Send a form to AA#zive.com,BB#zive.com,CC#zive.com.
For example, BB only has a project planned, so BB receives the form which asks: Is Your project planned or completed?
BB chooses the first option and fills in the details.
BB gets a unique ID which is inserted into the first column of the responses.
The ID is sent back in a response email to BB (perhaps the linked script can be tweaked to send the unique ID).
After a couple of months, BB has completed the project, so BB goes back to the form, either via the same email sent in step 1, or the same form embedded on a website.
BB now chooses the second option, since the project is completed.
The form asks for the ID number, BB fills it.
All of BB's answers now go to the row with the matching ID, overwriting certain fields if necessary...
I am aware that this might be a bit complex, but any even partial answer accompanied by some snippets of code would be highly appreciated. I will gladly share it once I manage to compile the whole idea. :)
Google Forms doesn't allow respondents to search previous sent responses. The only way that they can access a previously submitted response is by the edit response URL. To get this URL programmatically, use getEditResponseUrl.
You could send this URL by an email. For details see How to add "Edit Response" link to Google Forms emails?

Is there a way to embed an iframe in an email with text that updates?

I want to embed an iframe inside an email that contains the 10 most recent chat messages. Is there a way to make this iframe dynamic so that it always shows the latest 10 chats regardless of when the email is opened? If the iframe is not the correct way to do this, is there a better way?
You can implement an iframe into the email - but your mail will be recognized as spam by many providers.
You should try to render your content dynamically into an image and implement that image into the email.
There kind of is a solution. It is using Dynamic CSS with a fallback of a Dynamic image to pull the information. It is not elegant really as for some clients (e.g. Outlook) this is not available at all and will only display initial information. It also utilizes a link for a style sheet which also severely limits which clients this will work in.
The fall back dynamic image is a bit more comprehensive in client support, but much harder to maintain as you will need to build something that programatically pulls the tweets (HTML webpage potentially) and then also have something that creates and hosts an image for the email to pull. This is not a short, simple thing to set up and may not be worth the required back end work for a simple email.
See this link for a bit more in-depth info on how this can be done for adding a live twitter feed into an email: https://litmus.com/blog/how-to-code-a-live-dynamic-twitter-feed-in-html-email
Since there was no accepted answer i thought i would give my input as well.
Litmus had done something similar for their live twitter feed in emails sometime ago.
The method i can think off is to create a PHP page which takes 10 images and makes it into 1. PHP can have a loop that checks for increments from a specific number and if it exists then add to that 1 image. When there is a new chat image added, PHP will disregard the last one and add the new in the loop.
For anyone reading this in 2022, this is possible with AMP.
Instead of an iframe, you can create a dynamic email easily.
check out amp.dev
Note: AMP is not supported by many email clients

What portions of the marketo code snippet can change?

My company is using marketo forms, and we are generating the page from a content management system.
We'd like to keep the contribution experience as simple as possible and prevent the user from contributing actual <script> tags.
The API documentation says they will give you a block of code that looks like this:
<script src="//app-sjqe.marketo.com/js/forms2/js/forms2.js"></script>
<form id="mktoForm_621"></form>
<script>MktoForms2.loadForm("//app-sjqe.marketo.com", "718-GIV-198", 621);</script>
My question is, what portions of this code are subject to change?
I am sure the 3 part hypen separated string and the integer being passed in can change.
What about the app-sjqe.marketo.com address?
The 3-part string is your Marketo instance ID, and shouldn't really change. The other integer is the form ID, which definitely will change depending on what form you want to embed.
The other thing that you may want to consider, is the other configurable options that you can send along with the form embed. For example, in the module that I have made for my CMS, I let the user put an optional 'thank-you' page URL, to redirect the form to after submission, and also a checkbox to optionally open the form in a lightbox on page load.
The simple module I made is for the Sitefinity CMS - happy to share code with you if that helps!

Drupal email file attachment on form submit

I have a form built into a block on one of my content types, the content type has a file connected to the node.
I currently have a form the will send an email to the address you put in with a default message (ie if you put into the form, me#myemail.com, this email will receive a message saying "thank you for your interest.. ..please find your document attached" etc) However I'm struggling when it comes to attaching the file attachment of that node to the form, I have downloaded the mimemail module but there isn't a lot of documentation on how to do it.
(I apologise for repeating this question from the Drupal specific SO but this area seems to get more traffic)
Firstly, I would recommend you transition to webform rather than your own bespoke solution - as great and admirable as that is.
In looking around for a webform strategy to test and recommend, I found something that should do the job for you.
Have a look at this tutorial.

using form buttons for spamproof email-addresses

I have been looking at some methods for spamproof email methods here. I'd like to propose a more simple approach: Since I need a couple of different email addresses I considered just using a selectbox with JS or serverside redirect, as per examples on here.
Because google doesn't spider forms (dixit Matt Cutts), and spam-harvester script don't either (I think????) this would make sense to do.
I would love to be able to do this without using a script. So why not use one form per email?
<form action="mailto:test#domain.tld" method="get">
<input type="submit" value="test#domain.tld"/>
</form>
It seems the button text can be copied but not pasted, so that's a disadvantage.
Is this approach any good? or any other recommendations?
A robot uses the text of the page to get the email. It does not care if that text is in a button or within the body so using a button will not help.
Outside of using javascript, the only solution I know of would be written text, an image or Flash.
Create an image with your email or write out the email like: "test at domain dot tld"
Flash could provide you with a more secure (but not 100%) way of allowing people to click on an email but would not work on iPhone browsers and those that do not have the plug-in.
Another way is to use a simple captcha to before displaying the email in the PHP code.
Email: (1+2 = ?) then test#domain.tld
Because:
The email address is still in the page, and thus easily harvestable
mailto: URIs as form actions often fail
The reason server side form handlers stop email addresses being harvested is because the email address is not exposed to the user.