'Need help passing URL Link with VARS in Contact Form 7 Email

Need help passing URL Link with VARS in Contact Form 7 Email How do we deal with Spaces in Form Var?

Have form that we want URL Link sent with Form Variables Ie. If user enters “John Smith” as “Name” field Space between John and Smith breaks link in Email.

Message Body: https://example.com/newform/?SellerName=[SellerName]&Type=[Type]

Link breaks at Space Between FirstName and LastName (Prefer not to create 2 separate field for First And Last Name, as we have may other field that could have space in them)

Received Link in email looks like:

https://example.com/NewForm/?SellerName=John Smith&Type=Seller

Need:

https://example.com/NewForm/?SellerName=John%20Smith&Type=Seller



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source