Cannot Seem To Replace More Than 1 Personalization Token
Posted: Sun Nov 16, 2008 9:36 pm
Edit: Found the fix for those who want to do this.
When creating the loop, use this: (Thanks to the author for suggesting this in an archived post
$search = array("[first]", "[last]", "[username]"); // These are the tokens use you. Format them accordingly
$replace = array($first, $last, $username); // those are the variables you use to replace the tokens, obviously
Then, you do this:
$message->setBody(str_replace($search, $replace, $emailmessage)); // replace $emailmessage with the proper variable for your "message" variable
I hope this helps somebody.
When creating the loop, use this: (Thanks to the author for suggesting this in an archived post
$search = array("[first]", "[last]", "[username]"); // These are the tokens use you. Format them accordingly
$replace = array($first, $last, $username); // those are the variables you use to replace the tokens, obviously
Then, you do this:
$message->setBody(str_replace($search, $replace, $emailmessage)); // replace $emailmessage with the proper variable for your "message" variable
I hope this helps somebody.