Created
August 6, 2013 10:17
-
-
Save kunal732/6163357 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//convert body to image | |
$imageUrl= file_get_contents("http://api.img4me.com/?text=".$urlbody."&font=arial&fcolor=000000&size=10&bcolor=FFFFFF&type=png"); | |
$imgName = $emailID.".png"; | |
file_put_contents('img/'.$imgName, file_get_contents($imageUrl)); | |
//html body to show | |
$htmlbody = "<img src=\"http://magicmail.io/img/".$imgName."\" />"; | |
$sendgrid = new SendGrid($config['sendgrid']['api_user'], $config['sendgrid']['api_key']); | |
$mail = new SendGrid\Mail(); | |
$mail-> | |
addTo($to)-> | |
setFrom($from)-> | |
setSubject($subject)-> | |
addUniqueArgument("filename", $imgName)-> | |
setText($htmlbody)-> | |
setHtml($htmlbody); | |
$sendgrid->smtp->send($mail); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment