The ability to also get some sort of unique ticket number per completed form in the notify me mail.
Hi @user8320
Could you please specify the name of your Form Builder where you’d like to apply this functionality?
I’ll be happy to discuss with our devs if anything can be done
At least for: Reparatie V2. That would make it easier for me to search in outlook since I handle all completed forms by email. In CSV Export you already have something similar. An ID. I just can’t get this one in the email and this ID is actually a little too long.
Here an example how I would like to see it in the mail, in outlook: Now it comes in like this in the subject line; Repair quote request // A2338 Apple MacBook Pro 13 inch M1 // Screen Replacement but I would prefer something like this: Repair quote request // Ticket number: 847452 // A2338 Apple MacBook Pro 13 inch M1 // Screen Replacement
Thank you, @user8320!
I’ve discussed your use case with the devs and, unfortunately, there is no way to implement it at the moment.
I’ve moved your idea back to the Wishlist and we’ll try to consider it in the future
ls it also not possible to get the [ID] in the mail like for example the [form-data]? Or for example the date with time in this format? [DDMMYYMMSS]. every completed form gets a unique number in the background, right?
The workaround with the date is possible using the Hidden field option.
Adding the code to the Custom JS
Add the code below to the Custom JS section on the Settings tab:
function formatDateTime() {
const now = new Date();
const day = String(now.getDate()).padStart(2, '0');
const month = String(now.getMonth() + 1).padStart(2, '0');
const year = String(now.getFullYear()).slice(-2);
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
return `[${day}${month}${year}${minutes}${seconds}]`;
}
const date = formatDateTime();
widget.setFieldValue('[current-date]', date)
Replace current-date
in the last line of the code with the actual ID of your Hidden field
Please check it out and let me know if you like the result
Hey there!
I tried this suggestion in my form because my client is a catering company and a unique ID for each quote request is critical so the emails don’t group together in Gmail (I considered using the email in the subject line as a unique identifier but that won’t work with repeat customers).
The first test form worked perfectly, and there was a unique number in the subject line. However, tests two and three had NO number in the subject line. Any idea why it only worked for the first test form submission?
Ohhhh… did it only work once because I’m still using the free plan? We are planning on upgrading but I was testing out Elfsight for the first time.
Hi @Juanima_Hiatt welcome to community,
Can you describe how you went about implementing this? Actually, this works well. I solved it like this and I also forward it to gmail, among other things.
And then add the ID to the email.
Unfortunately, I can’t judge whether this has something to do with the free plan, but it shouldn’t limit the functionality of the widget.
Hi @Sina! Thanks for the welcome!
After my post last night, I upgraded to the paid plan and then tried another form submission, and it generated the unique ID in the subject line. (Yay!!) The free plan doesn’t allow customizations, so I believe that’s why it didn’t work the other two times.
The JS Max shared above worked well for me; it was just missing the semicolon at the end. But after I added that it worked.
Thanks for sharing your solution, too!! So glad it works for you, and I’m happy there’s a workaround for all of us dealing with the Gmail grouping issue, too!
Apparently it wasn’t because I was using the free plan. I just did three test submissions, and again, only the first one showed up with a unique ID in the subject line.
I would rather not extract the user’s IP address – @Max is there another way to ensure that each incoming submission shows up with the unique ID in the subject line?
Thanks for your help guys!
PS: It seems it’s not grabbing the date/time upon submission:
I tried adding the following code at the end of the Custom JS, but it did not fix the issue. All the test submissions I’m doing now do not include the Unique ID (current date_time) in the subject line.
form.on('submit', () => {
const date = formatDateTime();
widget.setFieldValue('[current-datetime]', date);
});
form.on('reset', () => {
widget.setFieldValue('[current-datetime]', '');
});
Did you send the test submissions right from the website or from the widget’s configurator?
Morning, @Max !
I sent the test submissions from the website after publishing the form.
Got it, thanks!
I’ve passed this issue on to the devs and will update you once I have their response
Thank you!! I saw their test submissions, and that the second one still has no unique ID for some reason (weird!!). So I will eagerly await their response! Thanks again, @Max!!
Hi there, @Juanima_Hiatt
We’ve replaced the previous code in Custom JS with the new one:
const WIDGET_ID = '05dffc2e-bea0-4cfd-9d11-2701756b9e28';
const DATETIME_FIELD_ID = '[current-datetime]';
const form = document.querySelector(`.elfsight-app-${WIDGET_ID}`);
function formatDateTime() {
const now = new Date();
const day = String(now.getDate()).padStart(2, '0');
const month = String(now.getMonth() + 1).padStart(2, '0');
const year = String(now.getFullYear()).slice(-2);
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
return `[${day}${month}${year}${minutes}${seconds}]`;
}
widget.setFieldValue(DATETIME_FIELD_ID, formatDateTime());
form?.addEventListener(
'click',
(e) => {
if (!e.target.closest('[class*="ButtonBase__ButtonContainer-sc"]')) {
return;
}
widget.setFieldValue(DATETIME_FIELD_ID, formatDateTime());
},
true
);
Could you please test it out and let me know if it’s working fine now?