Send JS generated URL per E-Mail

SOLVE
Occasional Contributor

Hi,

 

we generate an URL based on a form that is entered with JavaScript, e.g. https://URL.io/welcome-affiliate?affiliate=company-name

 

They get send to this URL directly after filling in the form.

 

Now I would like to send this link per E-Mail as well, but I obviously can't integrate JavaScript in the E-Mail that is send out.

 

How can I do that?

Thanks!

 

 

 

 

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Solution
Occasional Contributor

Thanks for your answer!

 

I solved the problem:

 

1) Create a hidden field in the form

2) Use script to populate the form before sending it: $form.find('input[name="affiliate_id"]').val(affiliateID).change();

 

affiliate_id is the form field, affiliateID ist my variable.

View solution in original post

Reply
0 Upvotes
4 Replies 4
Top Contributor

<a href=URL.com?affiliate={{ contact.company_name }}>link</a>

You may need to put in the %20s into a custom company name field, if so you could have a hidden field and add it in on the fly with some more js 

Occasional Contributor

Thanks for your reply. Though, I am not sure if you understood my problem. Generating the URL isn't the problem, but implementing it in the E-Mail. As you said I am formatting the company name with JS.

 

Or did I get you wrong?

Reply
0 Upvotes
Top Contributor

I am perhaps misunderstanding the question.

 

The html I sent would go into the source code of a rich text in an email to produce a link that drops the querystring with the company name added via the personalisation field {{ contact.company_name }} or whatever ythe field is called.

 

Solution
Occasional Contributor

Thanks for your answer!

 

I solved the problem:

 

1) Create a hidden field in the form

2) Use script to populate the form before sending it: $form.find('input[name="affiliate_id"]').val(affiliateID).change();

 

affiliate_id is the form field, affiliateID ist my variable.

View solution in original post

Reply
0 Upvotes