How can I use one of the pre-set email texts for user registration in a custom module At /admin/config/people/accounts, there are several stock email messages set.
How can I use one of these when I am sending emails from a custom module?
The text that's being used in &quot;Welcome (new user created by administrator)&quot; is all that I need, plus there's the bonus that our client can edit this email in the future if they want to.
I can send the message easily enough using:
$params = [
   'title' =&gt; &quot;My Title&quot;,
   'subject' =&gt; &quot;An Account Has Been Created for you&quot;,
   'message' =&gt; Html::escape(&quot;Some text here&quot;)
 ];

$result = $mailManager-&gt;mail($module, $key, $to, $language_code, $params, NULL, true);

Is there a variable somewhere to get the pre-entered text?
I guess this should be possible via configuration API. Look for the suitable entry where the message body is saved, call it via the service to put it into a variable. Then you can do additional coding with the string variable.
More information you can find here:
Configuration override system in the docs