Can newsletter content be generated with PHP?

Go To StackoverFlow.com

1

I manage a live music venue's newsletter and the show listings/calendar on the main site are generated using PHP. Is there a way to generate content in newsletters via php?

Example, I create the newsletter.php file, upload the code to our newsletter service provider, and when someone opens the message, the latest listings are available in their email.

As of now, I'm only seeing a portion of the php code where I'd like to see the calendar...

2012-04-05 14:44
by Commandrea


2

You can generate the content of an e-mail with any scripting language, but only before sending it. Once the e-mail has been sent, it has to be in a format that e-mail clients understand (such as plain text or HTML).

2012-04-05 14:45
by Another Code
Okay- that sounds promising...yeah yeah. So I would create my template w/ php, go into my browser, grab that html code and then send? Something like that? If so, that would be amazing and save so much time in the end.. - Commandrea 2012-04-05 14:47
@Commandrea the best way to do it would depend on your newsletter service provider. If they have an API, you could write a script that passes the generated newsletter directly to them. Or perhaps they accept newsletter content from a specified external source? Your proposed solution also possible if they accept HTML input directly, though I would prefer something more automated - Another Code 2012-04-05 14:50
Thank you for your help. Sometimes just knowing something is possible helps : - Commandrea 2012-04-05 15:03


0

It's also very easy to send email with php, with the mail function.
You could generate the email from your php template, and if it looks how you want it to, click a button and send that email to the people on your mailing list.

It sounds like you have a newsletter-delivery service in place, but this is another option.

2012-04-05 15:12
by amindfv
Ads