Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding "web version link" in email by sendgrid

How do I add a link to a web version of my sendgrid emails like "having trouble reading this email, click here"?

[EDIT] I use a php sendgrid library include "sendgrid-php-master/SendGrid_loader.php";

And I use this code and it doesn't work :

$mail = new SendGrid\Mail();
....
$mail->setHtml('<a href="[weblink]">View this email in your browser</a><br />'.$sg_html_code);
...
like image 878
Abdelali AHBIB Avatar asked Dec 04 '13 14:12

Abdelali AHBIB


2 Answers

Just to confirm what Lirianna said, here you have the answer from Sendgrid support team to the same question:

Using [Weblink] will only be supported when using our Marketing Campaigns tool. To use this in a transactional template, you would need to create and host that link yourself.

like image 128
Cibergarri Avatar answered Oct 15 '22 17:10

Cibergarri


Please be aware that SendGrid terminated the [weblink] and [unsubsribe] in 2017 (30/09/2017). You need to migrate with the new migrating toolkit.

Read more from SendGrid here

like image 41
Lirianna Avatar answered Oct 15 '22 15:10

Lirianna