I want to show custom message on confirmation page (on custom URL). I created a custom URL in *.routing.yml file and added a method in controller class that returns an array :
return [ '#theme' => 'mycustom_confirmation', '#test_var' => 'Test Value', ];
Next, in *.module file,
- I added hook_theme function to return below array:
'mycustom_confirmation' => [ 'variables' => ['mycustom_var' => NULL, 'webform' => NULL, 'source_entity' => NULL, 'webform_submission' => NULL], ]
- I added template_preprocess_mycustom_confirmation function to add my customized variables.
Then I created a template file: mycustom-confirmation.html.twig file where I consume the customized variables to show custom message.
After all that, when I landed to confirmation URL (that I set in to admin/structure/webform/manage/webinar_training_request_1/settings/confirmation page) after webform submission , I dont see any message. I dont understand what I missed in module.