GET Adding Youtube Video to the Email Newsletter / Pechkin.com Blog / Sudo Null IT News FREE
TV burst into the life of the Internet all of a unexpected and, not to say, so lasting ago. Nonetheless, it has already turn an integral part of the life of any of U.S.. Video has become a business tool in promoting goods and services. Happening Youtube, you can feel product manuals, message videos, webinar entries, etc. Bill videos in e-mail newsletters is a very sensitive marketing be active. Accordant to our statistics, this increases the percentage of clicks in your newsletter aside 17% (compared to standardized ones without video recording).
But how to do this in your hypertext mark-up language mailing name layout?
Embedding videos from Youtube on web pages is simple - just copy the html codification from the iframe and place it on your data processor. Merely with the electronic mail newsletter such a feint leave not work. And, although the email newsletter also contains an html layout, you cannot insert an iframe into it for security reasons. We ajar Technical and body requirements for sending electronic messages to Mail.Atomic number 44. We use them as the main ones happening the Runet market (the share of Mail in our traffic is more than 70%).
... when exploitation HTML in your posts, make a point that the effectual structure of the HTML document is respected. It is forbidden to apply potentially dangerous objects such as ActiveX, JavaScript, VBScript, Java applets, Frames and IFrames, joined from outside CSS sites, Meta Refresh, etc. (the use of much elements may lead to the blocking of your mailings);
In addition, much iframes testament frequently plainly non display aright by electronic mail clients, programs, or web services. And even so, how to embed a telecasting in an email? The email marketing service Pechkin-mail.ru, atomic number 3 always, does all the rudimentary work for you.
The only effective way is to place a moving picture with an fighting link to the video as a screenshot of your video with the Play button on top of it. For example, it might look like this:
Indeed, linear and effective. The only negative is to manually take such a screenshot is dreary and takes some time. Pechkinsuggested a function for adding video in 2 clicks: you just click on the "Telecasting" block, insert a link to that and click "Insert". After that, a screenshot of your video with the Bring on push button and a link to the video on Youtube will look in the layout you create.
How is this enforced with US?
Pechkin always tries to help developers if they are moon-faced with the same questions, and so now we will discuss the algorithm:
- Parsing the connection from youtube, checking its validity, to get the video Gem State.
- We charter a screenshot from youtube in medium quality. This can cost done simply aside the link: img.youtube.com/vi/%YOUTUBE_ID%/hqdefault.jpg
- Cover the image of the "apple-like" Child's play button with a PHP affair.
- We upload it to Selectel cloud storage, get a link to the effigy, put in it into the newsletter.
- We are chuffed user.
Here is an example of a office in PHP that we exercise:
/** * Формируем скриншот из youtube с наложенной кнопкой act as * * @param $youtube_id Id of youtube-video url, если это не youtube, а rutube или vimeo * * @return * Url скриншота (480х360px) на selectel или локальной машине, если что-то произошло при загрузке * Beaver State FALSE if error */ function youtube_thumbnail_with_play($youtube_id,$url = '') { //А если у нас не youtube? if ($youtube_id === '0'){ if(stripos($url,'rutube.ru') !== FALSE){ preg_match("/HTTP:\/\/rutube.ru\/video\/(\w+)\//",$url,$matches); $xml_info = simplexml_load_file("http://rutube.ru/cgi-bin/xmlapi.cgi?rt_mode=movie&rt_movie_id=".$matches[1]."&utf=1"); if ($xml_info) { $thumbnail_url = (string) $xml_info->thumbnail_url; } }elseif(stripos($url,'vimeo.com') !== FALSE){ if ((stripos($url,'https') !== FALSE)) {$vimeo_id = substr($uniform resource locator,18);} else {$vimeo_id = substr($url,17);} $xml_info = simplexml_load_file("http://vimeo.com/api/v2/video/$vimeo_id.xml"); if ($xml_info) { $thumbnail_url = (chain) $xml_info->video->thumbnail_large; } }else{ return Hollow; } }else{ $thumbnail_url = 'http://img.youtube.com/vi/'.$youtube_id.'/hqdefault.jpg'; } // Make sure the imagecopymerge() function exists (in Soman image library). if (!function_exists('imagecopymerge')) { return Dishonorable; } $image = imagecreatefromjpeg($thumbnail_url); if (!$image) {return FALSE;} $image_size = getimagesize($thumbnail_url); // Calculate the proper coordinates for placing the play button in the centre. $destination_x = ($image_size[0] / 2) - 35; $destination_y = ($image_size[1] / 2) - 35; // Load the dally button image. $play_button_image = imagecreatefrompng($etymon.'/images/play_button.png'); imagealphablending($play_button_image, TRUE); // Keep up transparency. imagealphablending($image, TRUE); // Preserve transparency. // Use imagecopy() to place the roleplay button ended the image. imagecopy( $image, // Destination image. $play_button_image, // Source image. $destination_x, // Address x coordinate. $destination_y, // Destination y coordinate. 0, // Generator x coordinate. 0, // Source y co-ordinate. 70, // Source width. 70 // Beginning tallness. ); if (is_dir($root.'/hypertext markup language/past/')===pretended){ mkdir($beginning.'/hypertext mark-up language/other/'); } $rand_path = $root.'/html/unusual/'.md5(meter().rand(0,100000)).'.png'; imagepng($image,$rand_path); $selectel_str = $wizard->cloud_upload($rand_path); //внутренняя функция загрузки файлов в облачное хранилище selectel if (strpos($selectel_str, 'http://static1.pechkin-mail.ru/') !== false) {unlink($rand_path);} imagedestroy($image); imagedestroy($play_button_image); return $selectel_str; }
Here is such a diminished, but selfsame convenient functionality upturned out. Pechkin users now easily upload videos from Youtube, Vimeo and Rutube to their email newsletters, increase the efficiency of their sales, and we get rays of good and joy from using the service from them.
DOWNLOAD HERE
GET Adding Youtube Video to the Email Newsletter / Pechkin.com Blog / Sudo Null IT News FREE
Posted by: turnerthoonions.blogspot.com
0 Response to "GET Adding Youtube Video to the Email Newsletter / Pechkin.com Blog / Sudo Null IT News FREE"
Post a Comment