How to replace text about [node:url] within a Rules Action? I'm using the Rules module and have a Rule created that, upon saving of new content, an email is sent out containing the node title, as well as the URL of the node. Pretty straightforward. That said, I want to replace text in the URL before the message that's sent out. I'm using str_replace() but it isn't working.

Any suggestions?

Update:

The path currently look like this: 
domain.com/cron.php/newsroom/press-release/[path-to-content]
However, I would need to replace out the "cron.php" from the URL, as that doesn't actually exist. 
So the new URL should look like this:
domain.com/newsroom/press-release/[path-to-content]

Here's an export of the rule. I've removed any sensitive information:

{ "rules_press_release_notification_test" : {
    "LABEL" : "Press Release Notification Test",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "php" ],
    "ON" : { "node_insert" : [] },
    "IF" : [
      { "node_is_of_type" : {
          "node" : [ "node" ],
          "type" : { "value" : { "press_release" : "press_release" } }
        }
      }
    ],
    "DO" : [
      { "mail" : {
          "to" : "",
          "subject" : "[node:title]",
          "message" : "We've added a new press release to our Newsroom:\r\n\r\n[node:title]\r\n\r\n\u003C?php\r\n$releaseurl = \u0022[node:url]\u0022;\r\n$releaseurl = str_replace(\u0022newsroom\/\u0022, \u0022\u0022, $releaseurl);\r\n\r\necho $releaseurl;\r\n?\u003E\r\n\r\n[node:url]\r\n",
          "language" : [ "" ]
        }
      }
    ]
  }
}
I would transform your existing rule into 2 separated rules like so:


Create a Rules Component that only performs a Rules Action which is to send an eMail, similar to what you already have in your current Rules Action. But replace the node:title and the node:url by corresponding parameters to execute this Rules Component.
Replace the Rules Action of the rule you already have by the execution of your newly created Rules Component, in which you pass as parameter values:


the title of the node
the appropriate string that matches your domain.com/newsroom/press-release/[path-to-content]



With that, you don't need any PHP, so no str_replace() either.