php - Hiding unsubscription and View it online links when viewing newsletter online -


i have case. have site sending newsletters subscribers. email template generated php template (e.g. single-newsletter.php)

when user receives newsletter in email client, he/she can read content see these links:

a.) link view newsletter online (this online content still using single-newsletter.php template).

b.) link unsubscribe newsletter.

everything perfect in email side, working intended.

my problem when user clicks on "view online" link, newsletter (which viewed online , not on his/her email client) still has "view online" , unsubscription links. want these 2 links removed. there easy , simple way (without side effects existing setup) can remove when user viewing newsletter online?

the email body generated doing file_get_contents email template put on $mail_body variable. thinking of using condition in php:

if (empty($_server['http_user_agent'])) {  //no user agent, file_get_contents reading //render view online , subscription links //so appear in email body  } else {  //user agent detected, must user reading online browser //don't show view online , unsubscription links  } 

please let me know if solution, if have other solutions. please share. thanks.

thanks tips.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -