We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25847
    • 62 Posts
    Ok, so neither placeholder seems to be working currently.

    So if I add the following line around line 686
    $modx->setPlaceholder('user.country', $this->StringForCountryInt($value));

    I should then be able to use the placeholder [+user.country+] correct?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      No. You would need something more like
      $_POST['country'] = $this->StringForCountryInt($_POST['country']); // add this line at line 686
      foreach ($_POST as $name => $value)
      {
          $toReplace = '[+post.'.$name.'+]';
          $message = str_replace($toReplace, $value, $notification);
      }
      

      This will replace the numeric value with its corresponding country, then when it gets processed in the following foreach loop it will have the value you want. Hopefully.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 25847
        • 62 Posts
        PERFECT! Thank you so much! I can finally be done with this client’s site now! grin Worked like a charm.

        I added that line at line 686 and then used the placeholder [+post.country+] and it emailed me the correct value for the country rather than the numeric value.