Hello,
I would like to create a helper to send emails with wp_mail
using a blade template.
The idea would be to create a helper in the setup.php
The problem of doing this is that I don’t have access to the Acorn Application.
I would like to make a helper this way:
function sendCustomerMail(string $to, string $subject) {
$content = \Roots\view('email.quote')->render();
wp_mail($to, $subject, $content);
}
But when I try to do that, I get an error:
Uncaught Error: Call to undefined function app() in xxxx/vendor/roots/acorn/src/Roots/helpers.php:70
Anyone have an idea how to render a blade view if we are not in a Composer or Component?