-
☆ A M B ☆
- 130 Posts
In our (soon to be released) newsletter 3PC it is possible to personalize each newsletter using placeholders ( [[!+firstname:default=`Subscriber`]] ). The script gets the complete content using php’s file_get_contents(). Problem with this approach: the placeholders will allready be parsed. Ofcourse, we want to parse them in our own code.
How do we get the full content of a resource with just some (firstname, lastname, email, company, unsubscribe link) placeholders unprocessed?
Jeroen Kenters
MODX Professional | MODX Ambassador | Dutch MODX forums moderator
website |
twitter
If there are placeholders in the file, you can just use str_replace() to process them yourself in your code before MODx sees them. If you’ll be doing this multple times, you’ll want to save an unprocessed version of the newsletter text in a separate variable for reuse. Unless I’m misunderstanding what you want, I think Smarty would be overkill here.