public function parse($item)
{
$body = $item['body']['text'];
$item['extra'] = $this->extraToArray($item['extra']);
$specialValues = $this->getValues($body);
if (count($specialValues) > 0) {
$specialValues = array_filter($specialValues, function ($value) {
return starts_with($value, 'extra.') || starts_with($value, 'to.') || starts_with($value, 'from.');
});
foreach ($specialValues as $replacer) {
$replace = $this->mixedGet($item, $replacer);
if (empty($replace) && static::$strictMode) {
$error = "the following [{$replacer}] param required from your category it's missing. Did you forget to store it?";
throw new ExtraParamsException($error);
}
$body = $this->replaceBody($body, $replace, $replacer);
}
}
return $body;
}