Last active
November 18, 2016 14:29
-
-
Save rehmatworks/172b2531cadc4fa9cf5ecbd8f9dd62db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once ('/path/SimpleShortcodes.php'); | |
$simpleshortcodes = new SimpleShortcodes(); | |
$shortcodes = array('[name]' => '{$name}'); | |
$simpleshortcodes->add($shortcodes); | |
// An array that contains user information. You can use multidimensional arrays to include more details about the user | |
$users = array('User 1', 'User 2', 'User 3', 'User 4', 'User 5'); | |
$message = 'Hello [name], we are here with the introduction to our newest product. Blah blah blah...'; | |
// Loop through the array and create $name variable which we need for our shortcode | |
foreach($users AS $name) { | |
$message = $simpleshortcodes->read($message); | |
var_dump($message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment