Question

Hello what i am trying to get is when i click on a link in the email it captures the subject of email and pass it as a parameter in the url to another page where i can store this subject line. for example here is my email template code

<a href=" https://forms.netsuite.com/app/site/crm/externalleadpage.nl?compid=31156&   formid=71&h=7a67f393397380048296" target="_blank">Download this publication featuring  research from Gartner now</a>

in href i would like to pass the email subject as parameter to other page which is a form.

Was it helpful?

Solution

I think this really depends how you generate the email subject and body, when generating the email, if you are using a server side script, you can just put the mail subject variable to the link in the mail.

For example, if you are sending the mail using php mail function, and here are the code to send it.

$to      = 'nobody@example.com';
$subject = 'the subject';
//Notice that we just included the subject in $message as part of the link address.
$message = '<a href="https://xxxx?subject=${subject}">xxxx</a>';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);

If you are using other tools, the method will be similar.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top