Roundcube Community Forum

 

Alter config in startup

Started by dkemens, May 17, 2024, 11:22:52 AM

Previous topic - Next topic

dkemens

Hi all,

I'm building a plugin to alter the product name (captured from a separate system) on startup. Unfortunately, it seems like the template loads before the plugin does it's business. In my template, I have

<roundcube:object name="productname">

I've tried altering this to

<roundcube:var name="config:product_name">

But it seems to make no difference.

The plugin does this:


    public function init()
    {
        $this->add_hook('startup', [$this, 'bootstrap']);
    }

    public function bootstrap($args)
    {
        Brand::init();
        $rcMail = rcmail::get_instance();

        $rcMail->config->set('product_name', Brand::getMeta('siteName'));
    }


I've tried moving the add_hook and all logic inside of an onload() method - but I haven't found any success yet. Anybody have any thoughts/tips?

Thanks!