X Xon Well-known member Mar 4, 2018 #1 Affected version 2.0.2 When using email templates, you can't set the mail's subject from inside a macro. It just silently fails rather than give an error or work.
When using email templates, you can't set the mail's subject from inside a macro. It just silently fails rather than give an error or work.
Chris D XenForo developer Staff member Mar 5, 2018 #2 Hmm, are you sure? My test case seems to work. I edited email:watched_forum_reply and replaced the subject tags with: HTML: <xf:macro template="thread_forum_macros" name="subject" arg-thread="{$thread}" /> Then I edited email:thread_forum_macros and added: HTML: <xf:macro name="subject" arg-thread="!"> <mail:subject> {{ phrase('reply_to_watched_thread_x', { 'title': prefix('thread', $thread, 'escaped') . $thread.title }) }} </mail:subject> </xf:macro> And the email was sent and the subject was displayed correctly.
Hmm, are you sure? My test case seems to work. I edited email:watched_forum_reply and replaced the subject tags with: HTML: <xf:macro template="thread_forum_macros" name="subject" arg-thread="{$thread}" /> Then I edited email:thread_forum_macros and added: HTML: <xf:macro name="subject" arg-thread="!"> <mail:subject> {{ phrase('reply_to_watched_thread_x', { 'title': prefix('thread', $thread, 'escaped') . $thread.title }) }} </mail:subject> </xf:macro> And the email was sent and the subject was displayed correctly.
X Xon Well-known member Mar 5, 2018 #3 Ok, I'm not sure what happened then. I went for a while where it wasn't rendering the subject. I just tested it then, and it worked.
Ok, I'm not sure what happened then. I went for a while where it wasn't rendering the subject. I just tested it then, and it worked.