- Issue created by @marcellinostroosnijder
- π¬π§United Kingdom adamps
I believe it is a matter of timing.
BodyEmailAdjuster->build() runs with weight 400. It saves the variables into
#context
.Your hook likely runs with default weight of 500. If you change your weight to 300 it should work.
- Status changed to Fixed
7 months ago 5:22pm 25 September 2024 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
3 months ago 6:05pm 12 January 2025 - πΊπΈUnited States rondog469
@adamps, can you expand on your answer? How do I change the weight? I am trying to set a variable inside HOOK_mailer_post_render but am getting an error saying "setVariable function is only valid in phases 0-1, called in 3.". I'm sure I also need to change post_render, but I cant find what to change it to.
- π¬π§United Kingdom adamps
To change the weight you need to use one of the other ways of doing a hook, see https://www.drupal.org/docs/contributed-modules/symfony-mailer-0/develop... β .
Currently you can't change variables in post-render. I agree it should be possible, there might already be an issue.