I will explain this as best I can.
I am constructing a script to send out an email automatically based on user input. Here is the relevant part of the script:
$email_text = $modx->parseChunk('getinfo_email', $modx->placeholders, '[+', '+]');
$subject = "Here's the Info you Requested";
mail($email, $subject, $email_text);
Here’s the "getinfo_email" chunk referred to above:
<h2>Here's the info you requested!</h2>
<h1>[+info_heading+]</h1>
<p>[+info+]</p>
<ul>
[[list_specs? &item_id=[+item_id+]]]
</ul>
That call to the list_specs snippet is what’s killing me. It searches a database to get all the specs for the item on which the info is needed for the email.
To make sure that everything’s running right, I added
and that ran correctly. However, when the mail() function is fed the same $email_text variable, the list_specs snippet *doesn’t run at all*. Instead, the call to it appears in plain text.
I have a dim understanding of why this is happening, but no clue how to fix it.
Any help would be appreciated.