In cerca: Strumentu di Previsualizazione di E-mail in Linea

Avete mai rimarcatu quanti clienti di email bluccanu l'imaghjini è mostranu u testu alternativu? Sò curioso se qualcunu hà veramente vistu questu emulatu aduprendu JavaScript o script di latu Server. Mi piacerebbe uttene una manu nantu à un strumentu chì a faci. Cù u tempu, sò sicuru chì possu sviluppà una tale pagina ... In realtà aghju cuminciatu à ghjucà stasera. Eccu una funzione chì elimina tutte e vostre imagine nantu à una pagina:

funzione replace () // caccià l'imaghjini
{
var imgs = document.getElementsByTagName ('img'); // array
per (var i = 0; i> imgs.length; i ++) // loop
{
imgs [i] .src = ""; // imposta l'imaghjini à nunda
}
}

Hè abbastanza semplice Javascript. A prima cosa chì facciu hè di raccoglie una serie di immagini in HTML. Un array hè un gruppu di elementi. Aghju dettu à u javascript per uttene ogni elementu chì hà un tag img. (Eccu cumu si vede l'imaghjini in HTML). Dopu aghju "loop" attraversu u array dicenduli di cumincià cù u primu articulu (= 0), andate per quanti elementi ci sò (imgs.length), è quandu hè finitu cù u ciclu aghjunghje 1 per passà à l'articulu prossimu (i ++).

Ciò chì succede fondamentalmente hè chì l'array raccoglie a situazione di ogni maghjina nantu à a pagina, li attraversa, è mette ognuna in nunda. Ciò chì mi piacerebbe veramente fà cun questu hè di rimuovere l'immagine ma in realtà visualizà qualsiasi testu alternativu - cum'è un cliente di e-mail. Mi piacerebbe ancu rimuovere altri elementi di tavola è div per renderli cume si guarderebbe in parechji Clienti Mobile. Questu rimpiazzaria u tag di stile in linea è u furmatu di caratteri.

Qualchissia hà vistu o custruitu qualcosa di simile? Sì cusì, lascia mi una nota in u mo modulu di cuntattu. S'ellu hè scrittu in C # o soprattuttu JavaScript, pò ancu esse qualcosa chì puderia esse autorizatu à cumprà. U vantaghju di JavaScript hè chì puderia esse disattivatu è attivatu dinamicamente - una bella funzione! Intantu, continueraghju à travaglià mi stessu!

9 Comments

  1. 1

    That would be a really simple Greasemonkey javascript

    You’re almost there, just insert the alt tag as the nextSibling.

    then put it on userscripts.org 🙂

    You could also use Greasemonkey to XPI or whatever it is called to make it a proper standalone Firefox extension.

  2. 2

    Ciao Doug,

    lu Web Developer Toolbar has a tool for doing this specifically, called “Replace Images With Alt Attributes”. It does exactly what you want for free!

    It did throw up an accessibility issue with your site though. Turning images off leaves black text on a black background, so anyone surfing the web without images on won’t be reading your posts!

    Aghjuntu:

    .post { background-color:#fff; }

    should solve that without messing up your theme though.

    • 3

      Great find and catch, Phil! Thanks so much. I’m going to dig into this add-on a little deeper since I need some of that functionality in a page rather than the browser itself. Very cool!

      (I also updated my post class – thanks for pointing that out!)

  3. 4

    At Agency.com we use a product called pvIQ from Pivotal Veracity (http://pivotalveracity.com/solutions/pvIQ.php) that is a big help with your problem. We send our test emails to our various ISP test accounts and then pvIQ retrieves jpgs of the rendered emails from each of the accounts, as they would appear in different browsers. This saves us enormous amounts of time, as all we have to do is look at the resulting jpgs. I’d recommend it.

    • 5

      Hè Marca,

      Pivotal Veracity has some incredible tools! I know they’ve recently launched an API as well. I’m trying to do something a little simpler, just a ‘quick’ look that doesn’t require actually sending the email out. Imagine just a button to click and you can emulate how it would look, just to take care of the low-hanging fruit.

      Steven

      • 6

        Salute,

        I haven’t looked at this for a while, so I might be wrong, but don’t the portals keep changing their mail rendering software? If they did, I would think you’d be constantly playing catch-up if you tried to use your own test software. That’s why we use pvIQ: it sends us exactly what the portal would render.

        Mark

        • 7

          You’re absolutely correct. My thinking is simply developing a ‘quick & dirty’ previewer that someone could execute before sending to something like pvIQ… things like Alt tags and mobile previewing (tables removed, etc.). I definitely don’t want to try to keep up with the mess out there with Email Clients! Those folks at Pivotal Veracity are the pros at that!

          Steven

  4. 8

    Something like this?

    var showImages = false;
    function toggleImages() {
    var imgs = document.getElementsByTagName("img");
    for (var i=0;i

  5. 9

    I think a potentially useful addition to your idea would be the ability to preview the emails in the same manner that popular email clients do. It would take some time and research into how each one does it (what elements to they strip, leave in, etc.).

    You build a series of filters to choose from. Say, a GMail filter, Yahoo Mail, Outlook (PC, Mac, etc.) filters, etc. So, instead of having to have dummy test accounts with every service under the sun, you could cycle through previews of each one relatively quickly.

    …maybe I’ve said too much… 😉

Chì ne pensi?

Stu situ utilizeghja Akismet per reducisce u puzzicheghju. Sapete ciò chì i dati di i vostri dati è processatu.