TK
1
Load Text Content From PHP File
Hello,
I was wondering if it's possible to load content from a php file (that returns just a number) and display it in a <span> for example?
Anybody tried something like this? (not using ESP tools like Silverpop content scrapper)
Thanks!
You could do this by embedding an external CSS file, generated in PHP, that uses pseudo element to display some content. For example, the file would only contain the following rule :
You can read more about this concept from Litmus' How to Code A Live Dynamic Twitter Feed in HTML Email article.
Thank you Remi,
Gmail is not supported in this case, right?
No, support is actually very limited using this technique. (I think pretty much only Apple Mail supports this.)
[as live text, not an image]
If you want the email to be sent out, and then later updated with live text -- no, not possible.
However, you can use php to generate an image dynamically and pass that "text" to the email.
The biggest issue is that Google would cache the image generated as well -- so you might need to set up a server with the image generator as -- for example -- a random string filename in a folder, and set up a htaccess rewrite so that requests for /textimage/fdgffgfdgdfg43.php pulls information from /codefile/imagegenerator.php
Each email you send out has a unique random string used to pull the image -- and then when Google caches it, they will only cache for that one recipient at that moment in time. Other users each get a fresh version of the image at the moment they first open the email.
What's your context? I am using Vero which allows me to make a request to an external json or html object at time of message construction. You can see how that'd be useful as a request endpoint. PHP itself wouldn't work, but you could write it like this in Vero:
and have it return whatever from your my.site PHP app db