Extracting URL Data for Subject Line "Notify Me" Email

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?

1 Like

Welcome to the Community, @user1818 :wave:

I’ll check it with the devs and update you on Monday :slightly_smiling_face:

Thank you for waiting, @user1818 :wave:

Happy to say that it’s possible to do! You just should follow these steps:

  1. Create a Hidden field with the label Page Path:

  1. Add [page-path] to the Subject line

  2. 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 :slightly_smiling_face:

1 Like

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?

1 Like

Great! To hide the hidden field from the submissions, you should remove [form-data] mail tag and use [field-id] of each field:


You can find the ID of each field at the bottom of its settings:

1 Like