-
Couldn't load subscription status.
- Fork 57
Open
Description
I can't seem to get custom tokens variables to work in the subject/body.
My main use case:
I want to specify the subject from the API. How I send the custom tokens work in the vanilla templating system, but Twig doesn't get them.
Template:
Subject: {% TWIG_BLOCK %}{% subject %}{% END_TWIG_BLOCK %}
Body:
{content}
{signature}
{unsubscribe_text}
Request:
POST https://mautic.varigergo.hu/api/emails/EMAIL_ID/contact/CONTACT_ID/send
{ "tokens": { "subject": "xxxx", "content": "xxxxx" } }
Error:
[2023-04-09 13:37:09] mautic.CRITICAL: Uncaught PHP Exception Twig\Error\SyntaxError: "Unknown "subject" tag in "__string_template__63495053935a5082041ab9769b6c41ccf06b0329b0eeb8cb21a49cc072432a2c" at line 1." at /var/www/html/vendor/twig/twig/src/Parser.php line 160 {"exception":"[object] (Twig\\Error\\SyntaxError(code: 0): Unknown \"subject\" tag in \"__string_template__63495053935a5082041ab9769b6c41ccf06b0329b0eeb8cb21a49cc072432a2c\" at line 1. at /var/www/html/vendor/twig/twig/src/Parser.php:160)"} {"hostname":"ae6df2b3b54a","pid":50}
Metadata
Metadata
Assignees
Labels
No labels