Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php into non-dynamic 1

Status
Not open for further replies.

HelenBN

IS-IT--Management
Dec 9, 2004
70
US
I use an open source web calendar program. I am looking for a way to use our SPAM compliant eMarketing service to set up a weekly email to announce things to do to the subscriber list. I can create a custom html page and get the calendar upcoming.php file the way I want it, but the service does not allow dynamic programming so the php content does not show.

Any ideas?????
 
Also good to note that your e-mail program ill not display php content... so this is the reason the eMarketing program doesn't allow it.

So, how can you capture php to html view that isn't ugly and cumbersome?
 
i really don't understand your post. php is a server side technology. are you saying that your server does not support php? in which case quite simply you are not going to be able to use it to run your calendar or mail.

if it does run the mail ok and all you are wanting to do is generate a file which can be picked up by another application and used as the html for an email then that's pretty straightforward. consider this:

Code:
$filename = '/path/to/some/file.html';
$fh = fopen($filename, 'wb');
$message = '<html><body><div style="color:red">Hello World</div></body></html>';
fwrite ($fh, $message);
fclose ($fh);

the output of this script will be saved as a file called file.html and your mail program can just pick it up and use it as its template. if the mail program has template rules then just abide by those rules when creating $message.
 
Sorry my post was not clear.

I have a php based calendar program that runs great!

I can set up an iframe on an html page to show upcoming events with any parameter I set.

I also have an online subscription marketing setup.

I would like to send a routine email to announce upcoming events to subscribers.

the php populated info will not show up once it is received via email.

I am looking for any suggestions on how I can accomplish this routinely.
 
the php populated info will not show up once it is received via email.
i understand the words you are using, but not what you mean.

assuming your 'online subscription marketing setup' takes an html string as an argument or an html file as a template, what is wrong with the suggestion that i made above?

perhaps it would help if you gave more detail on how your 'online subscription marketing setup' actually works?
 
My knowledge of php is limited and my html knowledge is enough to be dangerous, so please be kind.

I can build an html file with an iframe with src= When I view it in a web browser, all is good.

I then import it into the eMarketing program, or, for arguement sake, copy the file and paste it into my new message in outlook (not express). There it is, I see it, it all looks good. Hit send. Receive it. The php part is blank.

So it doesn't work with eMarketing or Outlook.

Guidelines for the eMarketing program are as follows:
Q. What are some guidelines to creating a custom HTML campaign?

A. When applying your own HTML design to a campaign, consider the following;

1) Images or hyperlinks included in the custom HTML must be fully referenced to a URL, not a relative path or folder. For example, a reference to "myimage.gif" is not supported; rather, the reference should be presented as "
2) The HTML must not contain any dynamic content based on a scripting language (JavaScript, jsp, asp, php, cgi, etc.).

3) Some e-mail clients will not recognize the < body > tag in HTML-formatted e-mails, which may affect the background color setting and other information described in the < body > tag of an HTML document. One method to avoid this is to place a table completely around your HTML and set a background color on the table cell.

4) The Custom HTML text editor does not support the use of color in the < body > tag. If you would like to add color to your text, place your text in a < table > tag.

sssooooooo, I am looking for a work around.
 
Your problem is with mail clients, not PHP.

In general, mail clients aren't as robust as web browsers when it comes to rendering HTML. Most of the good ones also incorporate added security measures, such as blocking the loading of external references. The upshot is that you can't count on anything too complicated to work consistently on different clients.

In this case, I suspect the client might simply be blocking the source for your iframe (if it even supports iframes). This is actually a good thing, as loading external references automatically is insecure. But more to the point, because this is a client configuration issue, there's absolutely nothing you can do about it.

I suggest you abandon the iframe. If you really must have the calendar, do it in static HTML. If you don't want to manually update it every time, you could always try to incorporate the rest of your HTML directly into the calendar script. That way, you can simply view the calendar page and save it as HTML, which you could submit to this marketing service. Of course, that may or may not be workable, depending on exactly how the script functions and what you're looking for.
 
ah, well, the calendar works fine - is php. The only way to get alisting of events on an html page is to do an iframe with src=....upcoming.php.

I just tested saving the php page as html, then sent it. It arrived but the layout is off.

Thanks for the imput.
 
@Adahacker

i agree that it's as likely to be the mail browser although I am suspicious that the eMarketing company might also be parsing out the php reference. this can be checked by looking at the source code of the received message.

if this is the case you might be able to fool the mail browser by putting the iframe source as an html file and on the server that hosts the file, tell the webserver to send html pages through the php parser as well. the OP is still at risk from email clients spitting out the iframe, of course.

alternative (as you suggest and as I also have) - the OP should fully render the email as html and pipe the resultant html into the eMarketing API.

further alternatively abandon this eMarketing company and write a bespoke script to send the emails. This is pretty trivial to do (a script like phpmailer from sourceforge will greatly facilitate this process too).

 
specifically, the eMarketing service uses double blind opt in and meets the CAN-SPAM legals. That's why we chose it.

The php calendar is a sourceforge project but doesn't offer a subscription email tool for public mass emailing.

and, if I remember correctly, the host, godaddy, doesn't allow phpmailer, to try to also thwart spam.

what a tangled web.

I will try the fake out with the iframe or something else scr= another html page and let you know.
 
nope, that didn't work.

it's gotta also be the frame.
 
look at the source of the email you are receiving. is the iframe there?
 
yes, iframe is there. code reflects the entire html page. but the view is blank.

so it's not the iframe...
 
does your mail browser prevent access to iframes?

try taking the source and loading it into a web browser. does it then display as it should?
 
upon googling iframe and Outlook, it looks like a security vulnerability issue that perhaps has been solved by blocking iframe content.

So back to the original question, is there a way that cleanly converts the html page with iframe scr=...upcoming.php to straight forward html, or am I dreaming?

I really would want this to run automatically, database driven, rather than open the html page, copy the iframe/php content and then paste into something else.
 
build the whole page in php, send its output to an html file. no reason why that can't be automatic, depending on the structure of your eMarketing provider. you have not provided us with details on their API so it is rather difficult to advise you definitively. Why don't you see advice them your provider?

alternatively you could replace the iframe with an image tag and use php to render the content you want into an image for display. the image can be dynamically created (and cached) from your html output.
 
sorry, I know hardly anything about php. I learn by doing and sometimes that takes some doing!

eMarketing Provider is through GoDaddy. Don't know the API. GoDaddy offers very little info that matters:


Since the WebCalendar isn't something GoDaddy offers, they aren't going to want to help me with that.

WebCalendar on Sourceforge forum has other users wanting to do the same thing I do but they aren't addressing it and haven't been:


What else can I tell you that you need to know? If you already asked me for something and I didn't tell you, chances are I don't understand what you're asking for.
 
the bit that i'm still missing is the process for sending mails through goDaddy. is it all done through a web interface or is it possible to issue a GET/POST command with the text you need?

is it a requirement that you have an iFrame? or are you ok with a css box list instead? or even just plainly put the appointments on the face of the email with no box?
 
This eMarketing pkg is an online interface. I have tried other php generated email and it fails because GoDaddy blocks that in their global php setup.

WebCalendar group says that the only way to have a lineup like a week listing on a html page is through an iframe. I don't know how to do a css box list. Would that fall outside of the dynamic scripting language limitation?

I thought it would be nice to have it be less involved than copy and paste, because I could set up the emails to launch the same day of every week and the event info would populate it automatically and always be current. This events calendar is setup to be "maintained" by around 120 users, so it is in constant flux.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top