I would love to be able to have the ability to add part of the URL to the Subject Line (not the entire Page URL). For example:
Page URL = domain.com/true-cost
Subject Line = True Cost
Is this possible?
I would love to be able to have the ability to add part of the URL to the Subject Line (not the entire Page URL). For example:
Page URL = domain.com/true-cost
Subject Line = True Cost
Is this possible?
Welcome to the Community, @user1818
I’ll check it with the devs and update you on Monday
Thank you for waiting, @user1818
Happy to say that it’s possible to do! You just should follow these steps:
Add [page-path] to the Subject line
Add this code to the Custom JS field on the Settings tab of your widget’s settings:
const [path] = window.location.pathname.match(/([a-zA-Z0-9-]+)$/);
const pathName = path
.split('-')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
widget.setFieldValue('[page-path]', pathName);
Please give it a try and let me know how it worked
That is super helpful!! It worked! Is there a way to hide that hidden field ‘page path’ from the form data in the body of the notification email just to make it more clean?